Manually link JIRA issues to Fisheye commits

Brian Yarr October 10, 2012

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
Chii
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 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 http://mercurial.selenic.com/wiki/HisteditExtension for how you might do it. But it isn't something that I would reocmmend doing.

You could install a pre-commit hook (see http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html) which will enforce that each commit message have the JIRA issue key. This will stop the problem of missing links between issues and changesets.

Brian Yarr October 17, 2012

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.

Tim Snyder November 7, 2012

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.

Jacek Konieczny September 10, 2013

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

etc.

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

InvidFlower September 11, 2013

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.

daniel.ly October 22, 2013

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

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 28, 2018

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.

0 votes
John Klancer December 2, 2013

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
Jacek Konieczny September 10, 2013

0 votes
John Conde February 27, 2013

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??

Suggest an answer

Log in or Sign up to answer