Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Calculate average

David Loszewski
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.
March 17, 2022

I have two fields I created, both text fields that I'm using with Jira Automation, one called:

Actual Response Time which takes the following:

{{issue."Time to first response".completedCycles.elapsedTime.friendly}} gives me a value like 20h 32m

The other is called SLA Response Time which uses the following:

{{issue."Created Date".diff(issue."Initial Response").prettyPrint}} and gives me a value of something like 10 minutes

My first problem is that the formats are obviously different, one is in hh:mm and the others in hours:minutes, is there a way I can make them both the same?

My second problem is that I would like to calculate the average of all the issues I have in a particular project for these two fields, so one average for SLA Response Time and one average for Actual Response Time.  

I know I can calculate field values using JMWE but not sure if there's a way I can do a lookup of all issues like you can in Jira Automation using a branch rule.  Maybe there's a way to calculate such a value in Jira Automation? 

Any help is appreciated. Thank you! 

1 answer

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.
March 17, 2022

Hi @David Loszewski 

For your first question, please take a look at the available formats for smart value date/times to pick the one you want: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

For your averaging question, the answer depends upon how many issues you want to average for this automation rule.  If it is 100 issues or fewer, you could use the Lookup Issues action and the list function for average.  If there are more than 100 issues, you may need to perform that calculation outside of a rule.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer