JQL for closed tickets that stayed in particular status for x days

Sach October 25, 2017

I have a jql query that lists me all issues that were closed between a time range in the past((resolved <= and resolved >=).  My jira board has 6 columns and some of the columns have more than one status mapped to it.
Is there a condition in the jql I can specify,  that,  it will list me only those issues that remained in a particular status(say "Testing") for 7 days or above ?

1 answer

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2017

Hi Sach,

Yes, JQL can track historical events on specific fields.  To so this you can use the CHANGED operator.  You can't use this operator for all fields in Jira.   But you can use this with the status field, so you could create a JQL like this:

status = resolved and not status changed after -7d

In turn this will return all the issues that have a status of resolved and that have not had any changes to their status in the past 7 days. 

I hope this helps.
Andy

Sach October 27, 2017

Hi Andrew,

Thank you for the suggestion.  That would give me all issues with a status of resolved with no further status change  over the last 7 days.  What I was looking for is to track a status that was prior to it going into a status of resolved - say, I have the following 4 statuses for my issue  - 'Ready to Work','In Progress','Testing','Resolved'  :  I want to see if an issue stayed in 'In Progress' or 'Testing' for 7 or more days prior to it finally getting moved into 'Resolved' status.  Would this be possible ?

To add, if it stayed in either 'In Progress' or 'Testing' status for 7 or more days, can I report that as well via a jql ?

Any hints would be greatly appreciated.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2017

Sorry if I misunderstood your intention here.  That kind of setup would be difficult to do with native Jira alone.  The JQL you would create for this can be setup to look back to a set time period (like -7d, or -5h), or to a specific date (yyyy/mm/dd format), but it isn't particular granular enough to search by the specific duration of a time period just yet.  And since the JQL is using the relative time for when the search is run for these time periods, it makes it more difficult to understand if an issue has really spent a full 7 days in this status before being transitioned.

So I can see that these would not necessarily be helpful to see issues that could have been transitioned at various different times for varying periods of time.

It might help to use a plugin such as Time in Status. This plugin can better help to see within Jira just how long each issue spends in each status.  With that kind of information it would be easier to see which issues meet that specific criteria.

Sach November 1, 2017

Thank you Andrew for the good info.

Suggest an answer

Log in or Sign up to answer