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

Automatically log work when status changed via Automation Rule

Muhamad Aliff Bin Sabri July 5, 2021

I was trying to create an Automation Rule which will log the work once the status transitioned. For example, from "In progress" to another status. However, it shows me this type of error.

automation rule.PNG

2 answers

0 votes
Emre Toptancı _OBSS_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 12, 2021

Hello @Muhamad Aliff Bin Sabri

If you are doing this for cost tracking, I don't recommend creating worklogs based on workflow transitions since it will probably produce inaccurate data. People usually don't work in a first-in-first-out manner so worklogs will just show you status time, which will be different the actual time spent on it. Status time data is already available in each issue's history. Also, your automation rule will not consider your working hours while creating worklogs so the results will probably be even more inaccurate.

 

In case you are OK with using a marketplace app, our team at OBSS built Time in Status app for this exact need. It is available for Jira Server, Cloud, and Data Center.

Time in Status allows you to see how much time each issue spent on each status or assigned to each assignee. You can also combine statuses into consolidated columns to see metrics like Ticket Age, Resolution Time, Cycle Time, or Lead Time

The app has custom calendar support so you can report on status durations based on your working hours (excluding non-working hours and weekends)

You can calculate averages and sums of those durations grouped by the issue fields you select. (For example, see the total InProgress time per Epic or average Resolution Time per issue type). 

tisCloud_StatusDuration_LeadTime_with Estimates.png  tisCloud_StatusDuration_LeadTime_Average.pngtisCloud_StatusDuration_LeadTime_Chart.png

The app calculates its reports using already existing Jira issue histories so when you install the app, you don't need to add anything to your issue workflows and you can get reports on your past issues as well.

Time in Status reports can be accessed through its own reporting page, dashboard gadgets, and issue view screen tabs. All these options can provide both calculated data tables and charts.

Using Time in Status you can:

  • See how much time each issue spent on each status, assignee, user group and also see dates of status transitions.
  • Calculate averages and sums of those durations grouped by issue fields you select. (For example, see average InProgress time per project and per issue type.)
  • Export your data as XLS, XLSX, or CSV.
  • Access data via REST API. (for integrations)
  • Visualize data with various chart types.
  • See Time in Status reports on Jira Dashboard gadgets

https://marketplace.atlassian.com/1211756

EmreT

0 votes
Bill Sheboy
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.
July 9, 2021

Hi @Muhamad Aliff Bin Sabri  -- Welcome to the Atlassian Community!

You note seeing an error, and I do not see an error in the image you posted.  What are you seeing that is not working?

Best regards,
Bill

Muhamad Aliff Bin Sabri July 11, 2021

Good day @Bill Sheboy

The objectives is to show a time spent per status by having a minus of Now() and time when timer start ticking.  I try to force log work in every issue transitioned by having above formula. But I was getting this error instead. 

automation rule error 2.PNG

Bill Sheboy
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.
July 12, 2021

Hi @Muhamad Aliff Bin Sabri 

If you just need to see time in status, I recommend instead using Jira's version of the control chart: https://support.atlassian.com/jira-software-cloud/docs/view-and-understand-the-control-chart/

If you still want to log the time instead, I do not believe you can query the prior worklog entry to find that difference.  Instead you might need:

  • a custom field to capture the last date/time a status transition happened;
  • calculate the difference from {{now}} to get your work log, time spent value; 
  • and then update the custom field to get ready for the next transition
Muhamad Aliff Bin Sabri July 12, 2021

Hi @Bill Sheboy 

If a custom field need to be created, what is the correct way to do it to keep the time track?

Bill Sheboy
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.
July 13, 2021

I believe I noted the steps you need above.  Please look here for more information about the date/time diff() calculations: https://confluence.atlassian.com/automation/date-and-time-functions-993924864.html

What have you tried so far?  If you have your updated rule, please post that so the community can offer suggestions.  Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events