How can you link source after a commit has happened?

Jay Barra
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2011

Occasionally I'll have forgotten to put an issue key in a commit message or other developers I work with, so the change set doesn't show up on source tab of the JIRA issue.

How can I retroactively link a commit to an issue so it shows up in the source tab of an issue?

3 answers

1 accepted

5 votes
Answer accepted
Dave Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 5, 2011

If you're using subversion together with fisheye, it's not enough to edit the commit message. You've also got to tell fisheye to re-scan subversion's non-versioned properties (revprops) for this commit. This is on the maintenance tab when you administer the fisheye repository.

But wait! That's still not enough! You've got to go to jira administration and flush the fisheye revision cache on this page: http://myjira.mycompany.com/secure/admin/ViewFishEyeCache.jspa.

At our site, we've got all this automated with a post-revprop-change hook. It helps if your subversion server is running on the same machine as fisheye. That way, you can run fisheyectl.sh from the post-revprop-change hook to tell fisheye to rescan. It would help a lot if there were REST calls for fisheye and jira to get these actions done, but sadly that's not the case.

MEDITECH ADMIN TEAM April 13, 2015

Just as an update, the Fisheye REST API does support rescanning a revision's metadata: https://docs.atlassian.com/fisheye-crucible/latest/wadl/fecru.html#rest-service-fecru:admin:repositories:name:rescan-metadata

J July 22, 2015

That's helpful, although you can't use the API token to call that, which means you have to embed somebody's password in your commit hook. Also there doesn't seem to be a JIRA REST API for flushing the cache (https://docs.atlassian.com/jira/REST/latest/)

MEDITECH ADMIN TEAM July 22, 2015

Just FYI - we asked Atlassian Support about the issue with using an API Token and they ended up creating https://jira.atlassian.com/browse/FE-5649

MEDITECH ADMIN TEAM July 22, 2015

Also, we were able to use the rescan-metadata API (with an Admin user) without flushing the cache

J July 22, 2015

Thanks! I also got it working, although since we're not flushing the cache, JIRA doesn't update things like the number of commits on an issue.

0 votes
Hector Palacios May 6, 2012

Hello, I'm using GIT and have the same problem. I don't know SVN but in GIT you cannot ammend a commit's message one you've pushed it to the remote. I would like to have a way to manually link a commit to an issue, for example, by adding the SHA1 of the commit to the comment of an issue.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 5, 2011

Edit the commit message

Suggest an answer

Log in or Sign up to answer