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
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!
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.
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:
(I've used the description field for the demonstration purposes:
Please let me know if you have further questions.
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).
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:
We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan. &nb...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events