-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add action to update an existing issue #77
Add action to update an existing issue #77
Conversation
leelasn
commented
Oct 11, 2024
- Adds an action to update an existing issue
- If the issue isn't changing teams, we need to populate team-specific options (project, status, labels) using the issue's current team, so this PR also updates the logic to populate those dropdowns accordingly
e559bcd
to
c04218a
Compare
} | ||
|
||
const updateIssueRequest = async (z: ZObject, bundle: Bundle) => { | ||
if (!bundle.inputData.issueIdToUpdate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just issueId
btw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to differentiate since issueId
is already used in another action and I didn't want to create any accidental side effects
const response = await fetchFromLinear(z, bundle, issueQuery, { id: bundle.inputData.issueIdToUpdate }); | ||
const data = response.json as IssueResponse; | ||
const originalLabelIds = data.data.issue.labelIds; | ||
labelIds = uniq([...originalLabelIds, ...bundle.inputData.labels]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man it would be nice if we had something in the API to enable adding/removing labels atomicly without having to fetch the entire set 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
sample: { | ||
data: { | ||
id: "7b647c45-c528-464d-8634-eecea0f73033", | ||
title: "Do the roar", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this sample data more realistic and not local.linear.dev
😉