How do I auto log time taken for an issue to go from one status to the next?

Andreas Knecht Community Champion Oct 10, 2017

Is there a way to achieve auto time logging using this add-on? I want to automate time logging and tracking such that a “timer” starts when an issue transitions to “In Progress” and stops when it transitions to “Done”. At the end of every month, I can then run time reports for management.

1 answer

1 accepted

This widget could not be displayed.

This is a pretty advanced usage but it can be done with Automation for Jira.

It is possible to do this using 2 rules. The first rule stores the first date on the original transition and then the second rule calculates the time difference and logs the work on the second transition.
Your first rule would like:

  • On Issue transition
  • If the status = "In Progress"
  • Set an entity property on the current issue for key "timestamp_in_progress"
    {{#now}}toMinutes{{/}}

The second rule would like:

  • On issue transition
  • If the status = "Done"
  • Log work using the "Edit action" and this in the advanced section:
    {
      "update": {
        "worklog" : [
          {
            "add": {
              "timeSpent" : "{{#=}}{{#now}}toMinutes{{/}} - {{issue.properties.timestamp_in_progress}}{{/}}m"
            }
          }
        ]
      }
    }

This will add how many minutes elapsed between the 2 transitions.

Here's screenshots of the 2 rules:

rule1.png

rule2.png

Hi @Andreas Knecht

Thanks for detailed description of the rules. But it seems that time is not logged after first transition occurred, and we're seeing "No time logged" on issue page. 

Are these rules only calculating time after final transition to "Done"? 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

30 views 3 4
Join discussion

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