Missed Team ’24? Catch up on announcements here.

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

JQl for how many days since a ticket was created

Jenny Thompson December 17, 2020

I want to know how many days since a ticket was created

So today's date minus created date = number of days

17/12/2020 - 12/12/2020 = 5 days

How do I write a jql query for this please?

I want to have the resulting number of days as a column in my queue

Thank you 

4 answers

4 accepted

5 votes
Answer accepted
Joshua Sneed Contegix
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.
December 17, 2020

Hi Jenny,

JQL doesn't perform the logic you asking for, it is a language for querying existing issue data. You will likely need Automation for Jira, or similar plugin, to perform that math and update a field. Check out https://support.atlassian.com/jira-software-cloud/docs/smart-values-date-and-time-functions/. Cheers!

Jenny Thompson December 17, 2020

Thank you for your response.

I have just started using Jira helpdesk and have automation for Jira - and written a few simple automations that work.

Cannot figure out how to do this one though - thought someone with more experience in the community might be able to give any help / advice on achieving this result.

Gökçe Gürsel {Appfire}
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 21, 2020

Hi @Jenny Thompson ,

You can create a text field, set up an Automation rule that triggers with scheduled and sets that field to the smart value:

{{now.diff(issue.created).abs.days}}

https://support.atlassian.com/jira-software-cloud/docs/use-smart-values-to-manipulate-and-format-dates/

(I've used the description field for the demonstration purposes:

Screen Shot 2020-12-21 at 14.42.03.png

Please let me know if you have further questions.

Cheers,

Gökçe

Jenny Thompson December 21, 2020

Gokce - THANK YOU ! 

This is exactly what I wanted and it works perfectly !

Gökçe Gürsel {Appfire}
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 21, 2020

@Jenny Thompson , it's my pleasure :) 

Happy holidays!

kakpindi
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!
August 24, 2023

@Jenny Thompson  2 years later and this was still extremely helpful. thank you

2 votes
Answer accepted
Zoryana Bohutska _SaaSJet_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 21, 2020

Hi @Jenny Thompson 

Yes, as you see, there a few solutions for your request in the Atlassian marketplace. But now, there is no ability to use JQL to get the data you need. To the list of tools above, you can also consider Time in status for jira cloud or Time between statuses add-ons. 

Regards

1 vote
Answer accepted
Emre Toptancı _OBSS_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 17, 2020

Hello @Jenny Thompson ,

JQL can only filter issues based on the criteria you provide. You see issue fields in the result set. JQL can't do calculations or manipulations on those issue fields, just returns what the fields contain.

The raw data required to calculate ticket age is already available in each issue's history. You can see it in the History tab of each issue's view screen. But Jira does not give it as a ready calculated data set.

You can use Control Chart of Kanban boards (available in Jira Software) to get reports on this. It does not give the Ticket Age for individual issues and has limited flexibility but might work for some use cases.

You can try getting the raw data via REST API and doing your calculations, if you are comfortable with developing code. 

Other than that, you will need to use a marketplace app to get this report.

 

For a ready built solution that offers great flexibility and details, 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 as well as entry/exit dates for all statuses. You can also combine statuses into consolidated columns to see metrics like Ticket Age, Cycle Time or Lead Time. You can calculate averages and sums of those durations and counts grouped by issue fields you select. (For example see the total InProgress time per Epic, or average number of InProgress transitions per issuetype). 

tisCloud_StatusDuration_Report.png  tisCloud_IssueView_Chart_StackedColumn.png  tisCloud_MainPage_Chart_Pie_ExcludeMarked.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.

The app has Custom calendar support which means you can get your reports based on a 24/7 calendar or your custom business calendar. (This one is important because a 24/7 calendar in most cases shows misleading data. For example an issue created at 16:00 on Friday and was resolved at 09:00 on next Monday seems to stay open for 2,5 days but in terms of business hours, it is only a few hours. You can see this using Time in Status by OBSS.)

Finally, the app has History Trim feature. This feature allows you to report on a subsection of issue histories instead of the whole history. Very useful when you want to focus on changes made during sprint or project phase.

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 issuetype.)
  • 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 (released for cloud, server&DC gadget coming soon)

https://marketplace.atlassian.com/1211756

EmreT

Jenny Thompson December 21, 2020

Thank you the app seems like it will fo what I require.  I guess for every basic function in Jira helpdesk there is an app to be purchased. 

This will get very costly

1 vote
Answer accepted
Yana Stoliarova December 17, 2020

Looks like you need Age Time (Age till Resolved). I implemented it with JiBrok app (free version - 2.5.2-jira8.3-8.11) and field JBCF:Age by resolution

Suggest an answer

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

Atlassian Community Events