GraphQL: no way to link an existing branch to an issue's Development section #212130
Replies: 2 comments 3 replies
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
+1 on getting an error instead of Until there's a proper API, here are two workarounds that may help: 1. Link a PR instead of the branch Open a PR (a draft is fine) from the existing branch and include a closing keyword in the body, e.g. 2. Delete the branch, then recreate it with
That should recreate the branch at the same commit, this time linked to the issue. I haven't tested this myself, so please try it on a throwaway branch first. Also be careful: deleting a branch closes any open PRs from it, and branch rulesets may block the deletion. |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Product Feedback
💬 Feature/Topic Area
API
Body
What I want
Link a branch that already exists to an issue's Development section from the API, the same way the issue sidebar's gear allows in the web UI.
What happens
createLinkedBranch(input: {issueId, repositoryId, name, oid})with the name and headoidof an existing branch returns{"data":{"createLinkedBranch":{"linkedBranch":null}}}with HTTP 200 and noerrors. Nothing is linked. Passingrefs/heads/<name>gives the same result.gh issue develop <n> --name <existing-branch>(gh 2.92.0) fails withfailed to create linked branch: API returned empty branch name.Why it matters
Branches are often created before their issue, or by tooling and agents that work through the API. Without an API to link them, the Development section stays empty, and automation falls back to comments.
Asks
createLinkedBranchlink an existing branch whennamematches an existing ref (andoidmatches its head), or add alinkBranchToIssuemutation.linkedBranch: nullwith noerrors.All reactions