Can I report Work Time in git commit messages?

Say I have an issue, "As a Jira & Stash user, I want to be able to update Jira issues with time spent when committing changes using git." This is issue SAU-34 as part of the Sunshine and Unicorns project.

If I perform some work and have a git repository with changes staged for a commit, I might commit with this message:

git commit -m "Recognising limited 'work spent' formats in git commits as part of SAU-34."

At present, the linkage is in place between the Jira issue SAU-34 (through the Source messages at the bottom of the issue details page) and Stash (though the automatic link generated on recognition of SAU-34 as an issue identifier).

Is there a possibility to enhance this linkage such that a commit of the form:

git commit -m "Recognising limited 'work spent' formats in git commits as part of SAU-34. Effort: 3h 25m."

Would not only provide linkage between Stash and Jira, but would also update Jira issue SAU-34 with 3:25 of effort, by default reducing the remaining estimate by the same amount of time?

I've tried searching through these answer/questions for terms such as work, effort, jira, stash, but either the issue hasn't been raised before or my Atlassian-Question-Fu is weak.

4 answers

1 accepted

This widget could not be displayed.

I have found one option here (the Smart Commits mentioned in Charles O'Farrell's message, which implements the functionality used by Christian Gagneraud's suggestion): https://confluence.atlassian.com/display/AOD/Processing+JIRA+issues+with+commit+messages

Another option is to use a local commit hook in combination with Bob Swift's Jira CLI: https://bobswift.atlassian.net/wiki/display/JCLIP/CLI+Plugin+for+JIRA

Using the Jira CLI + local commit hook avoids the issues mentioned by Charles O'Farrell, but does require access to Jira at the time the commit is made (thus you cannot include work effort in commits made while offline).

This widget could not be displayed.

Hi Alex,

I think you're looking for 'smart commits':

https://jira.atlassian.com/browse/STASH-2490

I'm not going to lie though - it's not something we're very interested in implementing at the moment. The reasons are due to the nature of Git and DVCS. For example. If you push to a fork repository, with a commit that contains your commit message, and then you merge to the parent repository, would you want the time to update again? Or delete the branch and then re-create it? What happens if you delete the repository or migrate to another Stash instance? It's a tricky problem to solve, and one that we would prefer to tackle with stronger/smarter integration with JIRA.

That said I suspect someone will inevitably implement it as a plugin, and I recommend watching the issue above for news and updates.

Cheers,

Charles

This widget could not be displayed.

If I'm not wrong, you can do it this way:

git commit -m "SAU-34 #time 3h 25m Blah Blah Blah "

This doesn't appear to be working for our Stash/Jira installation. Any idea what add-ons, plugins or configuration you have that might be enabling this functionality?

This widget could not be displayed.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,618 views 9 11
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you