Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Automatically Close GitHub Branches When Jira Story Moves to "Done" Status?

Lunara Inashova August 19, 2024

 

Hello Atlassian Community,

I'm looking for guidance on how to automatically close GitHub branches when a Jira story transitions to the "Done" status. We're using Jira Software for project management and GitHub for version control, and we want to ensure that branches associated with completed stories are deleted to keep our repository clean. I'm wondering if this can be accomplished through Jira's automation features or if I need to integrate another tool to achieve this. If anyone has experience with this or can suggest the best approach, I would greatly appreciate your advice.

Thank you!

1 answer

1 accepted

1 vote
Answer accepted
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2024

Hi @Lunara Inashova 

I think you need to look at the API from GitHub and based on Jira automation, send a web api call to GitHub to close a branch.

Lunara Inashova August 19, 2024

Thank you for your suggestion @Marc - Devoteam
Could you please  help me with more detailed guidance on how to set this up?

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2024

Hi @Lunara Inashova 

Suggest to read the API docs from GitHuB, if this is possible and what is needed to do so.

Jira automation: https://support.atlassian.com/cloud-automation/docs/issue-data-automation-format-payload-for-send-web-request/ 

Lunara Inashova August 20, 2024

Thank you, 

I was able to delete branches by hardcoding the branch name in the web request url, but I want to make this dynamic. How can I retrieve the exact branch name linked to the issue from GitHub?

Suggest an answer

Log in or Sign up to answer