Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

how to link an existing branch/pull request to a jira issue

Ionut Vicovan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 27, 2015

How can I link an existing branch (created from stash/git, not from JIRA by "Create branch") to a jira issue?

Same thing for a pull request (other than adding a comment with the pull request link...)

7 answers

10 votes
Chris Boudreau
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 26, 2016

Use the JIRA ticket number in the title of the pull request - that should link them.

Alfredo Pinto
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 9, 2017

In our case we use Git Flow which requiere that we create the branches like this: "Feature/XX-15" , "Hotfix/XX-22"

Is there a way that JIRA supports gitflow? 

Like 4 people like this
Chris Taormina
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 17, 2017

I use gitflow at my job and the link still seems to work just fine. I don't believe there was any extra setup for this.

Ionut Vicovan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 17, 2017 edited

the question refers to code you want integrated as resolution for your issue, which has been already developped and reviewed in an existing pull request, cherry picked from another branch, from upstream, etc. with names/ids not related to current issue.

this above mentioned code fixes an issue created in Jira by some other engineer/customer etc.

so how can you make the branches/pull requests not containing the jira id in the names appear in the list of branches/pull requests for the new issue?

Like mihail_t likes this
Kris Khaira August 23, 2018

I'd love to know how to be able to do this too.

It's weird that it's easier to do this between Pivotal Tracker and GitHub compared to JIRA and Bitbucket, two products by the same company.

Like 4 people like this
Julio Garcés Teuber
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 25, 2019

Hi @Chris Taormina 
Sorry for bother you, but you say you use gitflow and Jira at your job.
How do you handle release versions assigned to a Jira issue?
Here a full question: https://community.atlassian.com/t5/Jira-questions/Setup-Jira-Issues-version-when-using-Gitflow/qaq-p/1167931
Hope you can take the time to review it.
Thanks!

7 votes
David Karr
Contributor
January 23, 2020

This isn't an answer, but an acknowledgement of the issue in the original post.

In our org, we have the integration working such that if the issue is in the commit comment, then the "Development" section will link to that commit and pull request.

The problem is, if the developer forgets to put the issue in the comment, or misspells it, then the integration doesn't work.  There is no way to add references to commits or pull requests after the commit is created.  The feature is too limited.

2 votes
Binh Phan Duc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2018

Hi guys,

It would be great if your answer also contained a screenshot.

Then, it will be more helpful.

Thanks,

Binh

1 vote
Leo Stableford
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 25, 2020

I was just looking at this and I discovered that if you drop the Issue Number from Jira into the Pull Request title then it auto-links issue, PR and branch, so you don't have to redo all the branch naming and whatnot. HTH someone, as it was looking like a pain for me until I did that.

0 votes
Ana
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 21, 2021

Is this auto-linking deprecated? It stopped working for us a while ago and we can't find how to enable it again. 
It seems like the only solution so far is to enable "smart commits" 

0 votes
grazy27
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2020

Adding number of ticket with # ( #sample-1 )  anywhere in commit message links this commit and a whole branch to ticket.

Not obvious, not convenient.  If atlassian reads this - just copy user experience from azure devops

0 votes
Van Nguyen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 3, 2018

It doesn't seem to work with VSTS. Work with Bitbucket though

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Upcoming Jira Events