Skip to content

Ensure branches deleted in GitLab are deleted in Jira as well

Summary

Once you have setup the GitLab.com for Jira Cloud application in Jira, if you mention a Jira issue (e.g. GIT-1) in GitLab while creating a new branch (e.g. GIT-1-dev-branch), the branch appears in the Jira Development Panel.

However, when you delete the branch in GitLab, the branch still remains in Jira. Clicking on the branch will therefore lead to a 404 error on GitLab. Furthermore, if many branches are involved, it would be difficult to keep track of deleted branches from a Jira instance.

Looking at the code in branch_hooks_service.rb, branch data is only synced with Jira when creating and updating branches in GitLab.

Proposal

We should synchronize with Jira once a branch is deleted from GitLab to ensure the data on both sides is consistent.