Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate the difference between issue created and resolved

Ada Dedja January 25, 2022

Hello, 

I am trying to create an automation in Jira, where I store the time that was needed for the issue to be resolved when we have an outage, referred as "Down Time". I tried {{issue.resolved.diff(issue.created).hours}} and {{issue.created.diff(issue.resolved).hours}} but the result didn't make any sense. 
Is there a way I can obtain this result? I checked the math expressions, but no result. Thank you!
automation.pngresult.png 


2 answers

1 accepted

5 votes
Answer accepted
Pramodh M
Community Champion
January 25, 2022

Hi @Ada Dedja 

Can you use the below Smart value and let me know if this is convenient

{{issue.created.diff(issue.resolutiondate).prettyPrint}}

Ref here

https://community.atlassian.com/t5/Jira-Software-questions/How-can-I-list-the-difference-between-the-created-date-and/qaq-p/1874959

Thanks,
Pramodh

Ada Dedja January 25, 2022

Hi @Pramodh M 

Thank you for your help!

The Down Time is type "Date and Time Picker" it still shows a weird date, but I created another custom field "Short text type" and it worked.

Regards, 
Ada

Like Pramodh M likes this
0 votes
Admin January 13, 2025

@Pramodh M  hello , the result gives the duration off all days and not only business days .  Do you know haw to acheive the same result with only business days please ?

Dilan Koyunoğlu February 5, 2025

I need exact same thing!

Gizem Gökçe _OBSS_
Atlassian Partner
February 6, 2025

Hello @Admin ,

This is not possible with native Jira capabilities, as Jira does not provide built-in tracking for business hours when calculating time between issue statuses.

However, if you are open to use a 3rd party app, you can achieve this data with Timepiece - Time in Status for Jira  which is developed by my team at OBSS.  With the Duration Between Statuses report, you can track the time between the opening and closing of a ticket while considering only business hours. Timepiece allows you to configure custom calendars, defining your working hours (e.g., 8-hour workdays) and excluding non-working hours, weekends, and holidays. The report then calculates the exact duration based on your business hours.

Cstom Calendar.png

 

DBS Cycle Time 2.png

 

DBS Cycle Time 1.png

Quick Note: If you only need the raw data rather than a full report, you can retrieve the pre-calculated values using Timepiece REST API.

If you'd like to explore this solution further, feel free to check out Timepiece on the Atlassian Marketplace or schedule a demo with us for a walkthrough of the app's features. 

Hope it helps,

Gizem

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events