Skip to content
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

Conversation

leelasn
Copy link
Contributor

@leelasn 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

@leelasn leelasn requested a review from tommoor October 11, 2024 16:37
Copy link

linear bot commented Oct 11, 2024

@leelasn leelasn force-pushed the leela/fea-2976-allow-updating-existing-issues-from-within-zapier branch from e559bcd to c04218a Compare October 16, 2024 02:54
}

const updateIssueRequest = async (z: ZObject, bundle: Bundle) => {
if (!bundle.inputData.issueIdToUpdate) {
Copy link
Member

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?

Copy link
Contributor Author

@leelasn leelasn Oct 16, 2024

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]);
Copy link
Member

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 🤔

Copy link
Contributor Author

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",
Copy link
Member

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 😉

@leelasn leelasn merged commit 4d7f3d1 into master Oct 16, 2024
1 check passed
@leelasn leelasn deleted the leela/fea-2976-allow-updating-existing-issues-from-within-zapier branch October 16, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants