How to link existing JIRA issue to a existing branch in Bitbucket

Hi,

Have been using JIRA/Confluence Cloud and Mercurial on separate server 

We have just moved to Bitbucket Cloud and linked to JIRA that is working ok.

Within an a JIRA issue, there is an option to create a "Branch" in Bitbucket. This appears to work fine for new branches moving forward and that it displays the link to the branch from within the JIRA issue.

How can you link an existing JIRA issue to an existing branch in Bitbucket so that within the JIRA issue it displays the link. Within the issue it only has the option to create a new branch, not link to an existing Branch.

Jiralink.png

Have search forums and have not come across an answer for this.

If this has been answered somewhere, can you show me the answer?

Thanks in advance

 

4 answers

4 accepted

3 votes
Accepted answer

JIRA uses a simple technique to link issues and branches - You need to have the issue key in the branch name.

When you create a new branch, JIRA automatically adds the issue key in the branch name. Even if you create branches outside of JIRA with the issue key in it, they will appear in JIRA. But that also means that you cannot add existing branches unless you rename them to include the issue key.

Hi Jobin,

Thanks for reply. 

"When you create a new branch, JIRA automatically adds the issue key in the branch name. Even if you create branches outside of JIRA with the issue key in it, they will appear in JIRA."

We are aware of this. Our point was more linking existing Jira Issues to an existing branch that was already created.

 

"But that also means that you cannot add existing branches unless you rename them to include the issue key...."

We tried to preform this action to rename a branch to include the Issue Key, but was unable to to do this. Is this possible? if so how?

Our last option was to close the existing branch and recreate, or create another branch and merge. messy and one we were trying to avoid.

Peter

There is no easy renaming of branching in git. I think the proffered way is to rename the local branch, delete the remote branch and then push the renamed branch.

In Bitbucket, you can probably create a new branch, with the new name, from the existing branch and delete the existing branch.

But yeah, no easy solution I am afraid, unless you add a plugin to do it in one click ;)

Ok, Could be improved as I'm sure I would not be the first to raise this type of question.

Thanks once again.....

I too would LOVE to see this...

Like 1 person likes this

I would also like to see this.. being able to easily link jira and bitbucket branch is very much needed

Like 1 person likes this

Vote for this enhancement

Like 1 person likes this

+1

Like 1 person likes this

I'd also like to see this.  It's likely that many JIRA users would already have existing repositories and branches.

Like 1 person likes this
Like 1 person likes this
Like 1 person likes this

+1

2 votes
Accepted answer

+1

0 votes
Accepted answer

Definetely would like to see this improvement/enhancement also. We have a lot of branches, which are not connected to our Jira-issues.

0 votes
Accepted answer

+1

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,548 views 15 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you