Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,603
Community Members
 
Community Events
176
Community Groups

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

andreas Rising Star 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

0 votes
Answer accepted

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

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

@andreas  Hi Andreas! Thanks for ur answer! It was 3 years ago, but how do u think, is it possible to upgrade this 2 autimation rules to collect only working time (9 AM - 6 PM; 5/7)?:)

It might be easier to use Clockwork for automated time tracking as it does not require writing rules manually. It also logs time as a real user. 

Like Petr likes this

Jack, thanks! Yes, we are already using clockwork, everything is fine)

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events