I’m trying to find a way to see all the issues that have been sitting in one status for more than a certain number of days. Is there a JQL query that can do this?
Our workflow goes like this: New → Review → Schedule and so on. It’s okay for a ticket to be in New or Review for up to 3 weeks.
Right now, I’m using this JQL to find tickets in Review for over 3 weeks:
project = OurProject AND status = Review AND created <= -6w
But this doesn’t work well. It doesn’t actually check how long the ticket has been in the current status. Also, it doesn’t account for tickets that might move back to Review from Schedule.
Can I do this kind of search in JIRA? I can only use the built-in JQL, not the REST API.
I’m on JIRA version 6.4.5. Any help would be great!
I’ve faced similar challenges tracking ticket progress in JIRA. One approach that’s worked well for me is combining multiple conditions in your JQL query. Try something like this:
status = Review AND (
(status changed to Review before -21d AND status changed from Review is EMPTY) OR
(status changed to Review < status changed from Review AND status changed to Review <= -21d)
)
This query catches tickets that have been in Review for over 21 days, including those that may have bounced back from other statuses. It’s not foolproof, but it’s more accurate than just checking creation date.
Another tip: set up automated email alerts for tickets matching this criteria. It helps catch issues before they become problems. Hope this helps!
You’re right that the JQL you’re currently using isn’t ideal for tracking status duration. Unfortunately, JIRA 6.4.5 doesn’t have built-in functions for this. However, there’s a workaround using the ‘status changed’ function.
Try this JQL:
status = Review AND status changed to Review before -21d
This query finds issues in Review status that were moved there more than 21 days ago. It’s not perfect, as it won’t catch issues that moved back to Review, but it’s closer to what you need.
For a more comprehensive solution, consider upgrading JIRA. Newer versions have functions like ‘elapsed’ that can accurately track time in status. Alternatively, look into add-ons like ‘Time in Status’ which can provide this functionality in older JIRA versions.