github-to-linear icon indicating copy to clipboard operation
github-to-linear copied to clipboard

Link resulting Linear issue with Github

Open michaelbridge opened this issue 2 years ago • 2 comments

Great extension, thank you!

After clicking the Add to Linear button, the issue is created in Linear and becomes visible in the Github sidebar.

In an ideal world, the Linear issue would also be linked to the Github issue. Currently, this link must be established manually after creating the linear issue with the extension:

Screen Shot 2023-10-03 at 2 58 06 PM

When linked in this way, the Linear status proceeds automatically as the PR is approved and merged, which is a huge time saver.

šŸ‘šŸ»

michaelbridge avatar Oct 03 '23 19:10 michaelbridge

I’m not sure Linear supports this if I’m understanding what you mean correctly. Linear issues can be automated by linking GitHub PRs (not GH issues) — https://linear.app/docs/github#link-prs — but all the methods they support require the GitHub PR or branch to use a keyword, so not something that can be set up when creating an issue on Linear.

In case it helps, my workflow is usually as follows:

  • Add GitHub issues to Linear via this extension
  • When starting work on an issue, copy the branch name Linear suggests for my PR branch — this links the PR to the Linear issue
  • Use a Closes # comment in the PR to close the GitHub issue

This way, merging the PR closes both the GH and Linear issues.

delucis avatar Oct 03 '23 19:10 delucis

Thanks for your response. While I follow a similar task for scheduled work, this flow is extremely useful for unscheduled work or minor PRs that don't have a corresponding ticket.

Looking at the documentation, I think this should be possible via the Linear GraphQL API: attachmentLinkGitHubPR.

michaelbridge avatar Oct 11 '23 17:10 michaelbridge