Forums

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

how to get the difference between the created and resolution dates by only business work.

Admin
January 15, 2025

Hello, 

In our company, we want to automate the calculation of resolution time in business days. (without weekends, and local free days).

the diff function give us the total duration and not business work.

 

issue.created.diff(issue.resolutiondate) -> (exp: 3 days 18 hours 40 minutes 15 secondes)

 

I tried to manipulate the code and mines days , plus business days bit it seems that the format of the result of diff function does not support that.

we have a cloud jira service managemant instance.

So please, we need help to achieve this .

FTITI Walid

4 answers

1 vote
Piet Pieters
Community Champion
January 15, 2025

Hey @Admin , 

There is a syntax to calculate the difference in business days, however, then you will change the value you calculate with to days, and you lose the hour / minute / second data. 

{{issue.created.diff(issue.resolved).businessDays}} 

Screenshot 2025-01-15 164132.png

 

If you really need this information as well you could try some advanced calculations ( count difference in days > count difference in business days > substract previous results (then you know how many non-business days you had > count total difference in time > substract amount of non business days)

Hope this helps!

- Tessa

John Funk
Community Champion
January 19, 2025

@Admin  - Please reply inline with this thread so users can follow the conversation. 

What exactly about Tessa's solution does not work for you? Please give an actual use case with values. 

0 votes
Anastasiia Maliei SaaSJet
Atlassian Partner
June 2, 2026

Hi @Admin,

A reliable way to handle this without scripting is to calculate time against a work schedule using a Marketplace app. I can recommended - Time Metrics Tracker | Time Between Statuses, you would approach your case like this:

Create a metric that measures the time between Created and Resolution, or between the two statuses that represent open to resolved in your workflow. Apply a work schedule so only business hours are counted. For example, set it from Monday to Friday during your working hours, and you can also exclude local holidays and free days. Optionally, you can exclude statuses that shouldn't count toward the total.

TBS - 19 (1).png

The app then returns the exact business-time value. You can monitor it in reports or on a dashboard and look closely at specific issues if a result seems off.

TBS - 7.png

I’m happy to help with the setup if you need it.

0 votes
Fatma Uzundemir from The Starware
Atlassian Partner
June 2, 2026

Hi @Admin ,  👋🏻 

You're completely right—Jira's native smart values like .businessDays drop the precise hour and minute data, and trying to build complex workarounds with .diff() arithmetic often breaks due to format incompatibilities.

If you’re open to using a 3rd-party app to solve this seamlessly without losing precision, I can recommend ChronoFlow - Wait Time Analysis for Jira for this exact use case.

With ChronoFlow, you don't need any complex automation scripts or code manipulation. It handles the precision and business calendars out of the box:

🌱  Working Hours and Calendar Support

This is exactly what you need. You can configure your company's specific working hours and local free days/holidays. The app automatically excludes weekends and non-working hours from the calculation, while keeping your duration data 100% accurate down to the second.

detail-1.png

🌱 Time to Resolution

It calculates the precise duration from issue creation to resolution based on your custom business calendar. You can track this for individual issues or view the average time to resolution across a group of issues filtered by JQL (project, component, priority, etc.).

header-1.pngdetail-5.png

🌱 Time in Status & Active Time

If you ever need to go deeper than just creation-to-resolution, you can also see exactly how much precise working time was spent in each individual status (e.g., Open, In Progress, Waiting for Support), helping you spot where issues actually get stuck.

Other useful features include:

       📤 Reports grouped by assignee, status, or priority with Excel/CSV export

       📊 Issue view charts for workload and status comparisons

       ⏱️ Historical recalculation for existing issues (so you can see past data immediately)

detail-4.pngheader-2.png

🍀 To learn more, feel free to contact me or explore the application through the Atlassian Marketplace link I’ve provided. 🍀

Disclaimer:I work for the vendor who developed this application.

0 votes
Admin
January 16, 2025

Hello @Piet Pieters , thank you for response but that does not help me.

As i mention I tried already the advanced calculation by the diff function result's format not compatible with arithmatic operations when triying to retrieve non business days.  also We d'ont have 'businesshour' statemant to use and we have only businessdays that will make us loosing the precision with hours .

 

Regards, 

Walid FTITI

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events