How to calculate no. of days between two date fields?

Saprem Garg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2024

I want to calculate the age of ticket from start to end. Please help with the JSON.

 

Thanks.

Saprem

6 answers

2 votes
Michael Yaroshefsky - Visor for Jira
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 7, 2024

Hi @Saprem Garg 

Welcome to the Atlassian Community.

There was a similar question to yours a while back. The recommendation was to use a Script Field with a Number Field template.

See the full answer here https://community.atlassian.com/t5/App-Central-questions/How-calculate-number-of-days-between-created-date-a-custom-date/qaq-p/1982509

I hope this helps,


Michael

1 vote
Amay Purohit_RVS
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.
April 10, 2024

Hi @Saprem Garg 

 

Welcome to the community !!

 

You can use Jira Rest API's to pull this data or if you would be interested in a mktplace app for one stop solution, please take a look at 

Time in Status Reports 

The add-on provides the time in status of the entire issue workflow and there are 20+ reports in the app which help to meet a wide range of use cases.

One of the many reports is the Time between statuses as shown below, where you can specify your from and to statuses and the app will calculate the time between them, which should meet your requirements.

More details here

Do try it out.

Disclaimer : I work for RVS, the vendor for this app

TIS - Cycle Time report.PNG

1 vote
Valeriia_Havrylenko_SaaSJet
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 12, 2024

Hello @Saprem Garg  👋

Maybe these materials will be helpful:

1. API: Workflow statuses

2. Time between statuses add-on, which shows the Time between statuses.
To filter tickets that were stuck in a status, use Date Ranges. 
                                                        
Time Between Satuses.jpg

 
Also, in add-on you can set up Warning time limits and Critical time limit. If too much Time is spent on a specific issue, the system will send an email notification to you or any other user when a ticket is stuck in a status.

Знімок екрана 2023-12-18 о 15.12.16.png

The add-on has a 30-day free trial version and is free for up to 10 users.  

Please let me know if you have any questions

Hope it helps 😌

0 votes
Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 8, 2024

Hi @Saprem Garg

welcome to the community!

If you want to do this in native Jira, I believe you have to use Jira Automation and write the result into a custom field. I can't advice on the details, but this may be a good starting point.

As you've surely noticed by now, there are also a number of Marketplace apps that operate in this space. Just be aware that you can trial any Marketplace app for free for 1 month - so if an app is an option for you, perhaps try a few and see which one works best for you.

On this note, here's another app that you might like: JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of so-called history columns that aren’t natively available, including time in [status], time between [status] and [status]time between created and resolved, and many more.

This is how it looks in action:

time-between-created-and-resolved.gif

As you can see above, you can easily sort and filter by your history columns, and also use them across JXL's advanced features, such as support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting.

Disclaimer: I work on JXL.

Any questions just let me know,

Best,

Hannes

0 votes
Gizem Gökçe _OBSS_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 8, 2024

Hello @Saprem Garg ,

To calculate the age of a particular ticket, you can use 3rd party applications that have been developed for this type of specific need. For your needs, Time in Status which is developed by my team at OBSS, is the tool I would highly recommend. It is available for both Jira Cloud and Data Center.

Time in Status mainly allows you to see how much time each issue spent on each status or each assignee

Time in Status offers two report types for your case:

The first one is Status Duration report (please see the screenshot above) which shows how much time each issue spent on each status. You can combine the time for multiple statuses to get metrics like Issue Age, Cycle Time, Lead Time, Resolution Time etc. Report Types Status Duration Report.png

As an alternative approach, Time in Status also has Duration Between Statuses report type which shows the duration between two specific statuses. This report type also allows the user to exclude the times for "pause" statuses.

Report Types DBS.png

For all numeric report types, you can calculate averages and sums of those durations grouped by the issue fields you select. For example total in-progress time per team or average resolution time per sprint, epic, week, month, issuetype, request type, etc. The ability to group by parts of dates (year, month, week, day, hour) or sprints is particularly useful here since it allows you to compare different time periods or see the trend. 

Group by priority.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. It supports both Jira, JSM and JPD projects.

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. And the app has a REST API so you can get the reports from Jira UI or via REST. Also you can export the reports in to various formats easily. 

SS4.png

Visit Time in Status to explore how our JIRA add-on can revolutionize your reporting process. Enjoy a 30-day free trial to experience the full range of features.

If you wish, you can also schedule a live demo. We will provide a comprehensive overview of the application and address any inquiries you may have.

Hope it helps,

Gizem

0 votes
Bloompeak Support
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 8, 2024

Hi @Saprem Garg

Welcome to the Atlassian Community!

If you prefer to use a marketplace app, you can try Status Time Reports app developed by our team. It mainly provides reports and gadgets based on how much time passed in each status.

You can get age of a ticket by using lead time(the time interval between the moment an issue is requested to the moment it is completed) report. Here is the online demo link, you can see it in action and try without installing the app. For your case, you can have a look at Lead Time for Each Issue report.

For further details, you can have a look at Status Time Reports How to Videos.

  • This app has a dynamic status grouping feature so that you can generate various valuable reports as time in status, time in assignee, status entry dates and status counts, cycle time and lead time, average/sum reports by any field(e.g. average in progress time by project, average cycle time by issue creation month).
  • You can search issues by Project, Issue Type, Status, Assignee, Issue Creation/Resolution Date(and any other Date field) and JQL Query.
  • Status durations are calculated according to the working calendar you define. Once you enter your working calendar into the app, it takes your working schedule into account too. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days.
  • You can set different duration formats.
  • You can export reports in CSV file format and open them in MS Excel.
  • You can also add this app as a gadget to your Jira dashboards and reach “Status Time” from Issue Detail page.
  • You can enable/disable access to Status Time reports&gadgets and Issue Detail page per project, users, groups or project role.

If you are looking for a completely free solution, you can try the limited version Status Time Reports Free.

Hope it helps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events