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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JQl for how many days since a ticket was created

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

2 votes
Answer accepted

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!

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:

{{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

Gokce - THANK YOU ! 

This is exactly what I wanted and it works perfectly !

@Jenny Thompson , it's my pleasure :) 

Happy holidays!

1 vote
Answer accepted

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

1 vote
Answer accepted

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

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

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

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...

168 views 0 4
Read article

Community Events

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

Events near you