It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Manually link JIRA issues to Fisheye commits

Is it possible to manually link a commit to a JIRA issue i.e. not putting the JIRA issue in the commit message? I'm using mercurial if that makes a difference.

Having googled it does seem like the feature is alluded to but I can't find anything definitive.

If it isn't possible are there any alternative such as changing commit comments later or enforncing commit comments to have a JIRA issue in them?

5 answers

1 accepted

3 votes
Answer accepted
Joe Xie Atlassian Team Oct 11, 2012

It is not possible to manually link a JIRA issue to a changeset without changing the commit message to contain the JIRA issue key, which means you will have to edit the history of your repository.

Unfortunately, it isn't trivial to edit the history in Mecurial. See this plugin for how you might do it. But it isn't something that I would reocmmend doing.

You could install a pre-commit hook (see which will enforce that each commit message have the JIRA issue key. This will stop the problem of missing links between issues and changesets.

One way of achieving a similar effect is to use Crucible. You can manually link changesets to code reviews and link code reviews to JIRA issues.

Would it be possible to write a plugin for JIRA that puts a new link type in the "More Actions" -> Link menu off of an issue that would let you create a link that showed up in the "Issue Links" section on the issue? If that's possible, I might be interested in writing a plugin to do it. Then, once we have the link to a changeset in the Issue Links section, we update the FishEye plugin to add looking through there as well as doing the standard RPC search to FishEye for tags in commit messages.

Rewritting repository history is a big no for many use cases. In git this not only makes a repository 'incompatible' with its all existing forks, but also invalidates any signed tags on the affected branches.

And there are many scenarios when one can end with a commit which needs to be linked to an JIRA issue, but does not contain the issue key in the commit:

– user mistakes. Even best pre-commit and pre-update hooks won't help when a user have more than one issue assigned he can refer. If he refers wrong, this stays in the commit message.
– imports of legacy code. The code may contain other keywords to refer to issues, which could have been migrated to JIRA.

– it could be found after a fact, that an issue has been fixed by some commit


Manual (and programaticall, via API) linking is IMHO a must have for these applications.

I really feel like we do need this. As Jacek said, there's all kinds of situations where you might need to link them after the fact. Rewriting the messages is not the answer on Git and Mercurial.

A less satisfactory workaround is web-linking the issue to the URL which refers to the commit. A poor man's solution.

There needs to be a way to point into Fisheye from jira other than tags in commit messages. Forcing Jira issues to be added during commits isn't enough since more than one issue may need to point at the same source changes. Issues sometimes also need to point to commits already made.

Why can't Jira/Fisheye work like Jira/Confluence, link from anywhere to anywhere and get an automatic reciprocal link??

As a workaround, you can add custom number field, like "changeset", to the issue. Then this would be used with a SIL Scripted field to dynamically create a clickable link. I did this, but using the created date of the ticket to perform a fisheye search.

0 votes

A partial workaround:

Fisheye allows to add comments to commits:

Repository browser > Activity tab > Commits button > Select a commit 
On the commit page click the comment icon (it's located at left edge of the window) > Add comment

Unfortunately, text entered in the comment box is not indexed, so you won't be able to search for such commits with comments. It also won't appear on development panel in Jira.

But this is at least a way to add some metadata to repository commits.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Calling all Jira Cloud users! Give us feedback on our exploration of a new navigation.

Hi everyone! My name’s Matt and I’m a product manager at Atlassian. I work in the navigation & findability space for all our Jira Cloud products. We’ve been working on trying to improve the exp...

1,045 views 16 12
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you