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