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

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):

Another option is to use a local commit hook in combination with Bob Swift's Jira CLI:

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

Hi Alex,

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

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.



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?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

651 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot