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 show a jira issue link in bitbucket commit

Michael Beach
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!
May 28, 2018

Hi, I'm in the process of importing a Bitbucket issue tracker to a Jira Software project (all of this is cloud), and so I'm looking for a way of making the old issue references in my Bitbucket commit messages (ie things of the form issue #33) point to the imported issues in the Jira Software project (eg to issue FOO-33).

What I've done to achieve this is in Settings | Links in my Bitbucket repo I've added a custom link which matches on \#(\d+) and redirects to https://foocorp.atlassian.net/browse/FOO-\1.

Now this mostly works, but when I click the link it takes me from the Bitbucket page to the page for the Jira issue. However what I'd really like is for it to work the way it does when I click on a Jira issue key in a commit message (ie when using the provided Jira Software/Bitbucket integration), and have a summary of this issue pop up in modal box, but when I try to do this by copying and modifying the link destination Bitbucket inserts for a Jira link (as opposed to a custom link) I end up with an error page complaining about a missing JWT).

Is there a way to get the nice modal box behaviour for my custom link, or does it depend on some internal Bitbucket magic that is only invoked by a Jira link?

Thanks for your help!

Michael

1 answer

0 votes
jyo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 29, 2018

Hi Michael,

I think a lot of this would need to be a lot of custom work to re-write the commit messages. The link you have now (issue #33 for example), would need to be written as FOO-33 in the commit to correctly link back to the JIRA issue, and show history under the modal. Unfortunately, there really isn't an easy way to do this--as the workaround you're doing will work as you mentioned, but it's not "officially" going to be supported unless the actual issue in the message is changed to a JIRA project format.

Thanks,
Jesse

Michael Beach
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!
May 29, 2018

Hi Jesse, thanks for your answer.

I'm sorry but I don't understand what you mean when you say it would be a lot of custom work to re-write the commit messages.

The way I see it, the custom link I can already add does the re-write of the bits that matter to me (the Bitbucket issue references of the form \#\d+), and allow me to substitute a URL of my choosing. Is there some more re-writing required that I'm not aware of?

Michael

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events