12

I want to show all issues where it has been in a current status for more than X days - is this possible?

We have this workflow: Registered => Analyze => Planned ... etc. The ticket can be in Registered for 3 weeks and it can be 3 weeks in Analyze without any problems.

Currently I am using this JQL to show tickets that have been more than 3 weeks in Analyze:

project = MyProject AND status = Analyze AND created <= -6w

This is wrong due to so many reasons and it does not look at the time in the current transition state - nor does it take in to account that it can be pushed back from Planned to Analyze and then allow a new 3 weeks analyze period.

Is the above possible to filter in JIRA? I don't have the possibility to use the JIRA REST interface - only the builtin JQL.

I am running with JIRA version 6.4.5.

Beauvais
  • 2,149
  • 4
  • 28
  • 63

4 Answers4

10

You should be able to get there using the JQL CHANGED operator. Its documentation is available here.

Your query would look something like this:

project = MyProject AND status = Analyze AND status CHANGED BEFORE -3w
GlennV
  • 3,471
  • 4
  • 26
  • 39
  • This is not valid only and only if you have the status =Analyze is not repetitive in your workflow. In other words, if you got any status change from "Analyze" to "Registered" and then back to "Analyze" during this period then the query above will give a wrong result – user1017344 Aug 01 '17 at 19:29
  • 1
    @user1017344 That can be overcome with JQL like this: "AND status WAS NOT IN Analyze" or "AND status WAS IN Registered" – HeyZiko Mar 30 '18 at 17:02
2

If you want to know for what day range the issue was lying in a status and when status are consecutive, for example a UX review will happen before QA starts working on it and I want to know the issues which are lying in UX review for more than10 days then my JQL can be

project = *your project* AND status changed to "Ux review" before startOfDay(-10)  AND status changed from "UX Review" to "Ready to test" after startOfDay()  
Baum mit Augen
  • 49,044
  • 25
  • 144
  • 182
Gaurav
  • 21
  • 1
1
 project = MyProject AND status = Analyze and not status changed during (-xd,now()) 
user1017344
  • 181
  • 1
  • 1
  • 11
0

With Script Runner plugin I'd create a new scripted field that would just return the number of days since the last status change, with a Number field template, and Number Range Searcher. The

def items = com.atlassian.jira.component.ComponentAccessor.changeHistoryManager.getAllChangeItems(issue).findAll{it.field=="status"}

will return ChangeHistoryItems for Status field. Take the last one and use its getCreated() to find Timestamp. If the list is empty, it means that the issue is in the first step of the workflow, use its issue.getCreated(). Test. Re-index. Search. Use.