Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to search for issues that were in a status for longer than N days at any point in the past?

t m January 30, 2024

Anyone know JQL for searching for issues that were in a status for longer than N days at any point in the past (i.e. they are not currently in that status)?

 For example, if the workflow is: Backlog => In Progress => Review => Completed, how can I search for all completed issues that took longer than N days in Review?

 

Please note that I am not server admin I do not have possibility to install additional addons etc. But we do have ScriptRunner installed already if it helps.

4 answers

1 vote
Valeriia_Havrylenko_SaaSJet
Atlassian Partner
February 4, 2024

Hello @t m 👋 
This will generally work but it does not cover the case where it changed statuses and then went back to the previous status during the 14d window.

status = "particular status" and status was "particular status" before startOfDay(-14)

Also I will be glad if my article about JQL helps you with this question. 

And an alternative , I guess you can try Time in Status for Jira(developed by my SaaSJet team) with 7 types of status time reports

For example The Time in status report shows how long an issue has been spent in each status. You can filter issues by issues and time ranges and get report for issues that were in a status for longer than N days at any point in the past easily.

Time in status GIF.gif

You can also book a live demo - we'll show you the application inside out and answer all your questions.

Add-on has a 30-day free trial and free up to 10 users. 
Please, let me know if you have any questions

Hope it helps 😌

1 vote
Hannes Obweger - JXL for Jira
Atlassian Partner
January 30, 2024

Hi @t m

unfortunately I'm not aware of a native or Scriptrunner-based solution - perhaps someone else can lean in? - but just in case that Marketplace apps should become an option for you, this would be easy to do using the app that my team and I are working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of so-called history columns that aren’t natively available, including the longest time in status.

With these, you can create a view like this in just a couple of clicks:

time-in-review.gif

As you can see above, you can easily sort and filter by your history columns, and also use them across JXL's advanced features, such as support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting.

Any questions just let me know,

Best,

Hannes

0 votes
Gizem Gökçe _OBSS_
Atlassian Partner
January 31, 2024

 

Hello @t m ,

Unfortunately, there is no way you can do this with standard JQL. In order to get the results that you desired you have to use a marketplace app. If you are okey to use one, I would like to introduce you to a very advanced tool, Timepiece - Time in Status for Jira which is built by my team at OBSS. It is available for both  Jira Cloud, and Data Center.  The app has a 30 day free trial so maybe you can ask your Jira admin to install the app for you to try. 

Time in Status mainly allows you to see how much time each issue spent on each status or each assignee. The app empowers you to effortlessly track metrics like Response Time, Issue Age, Cycle Time, Lead Time and Resolution Time  directly within JIRA. 

Report Types Status Duration Report.png

For all numeric report types, you can calculate averages and sums of those durations grouped by the issue fields you select. For example total in-progress time per customer or average response time per year, sprint, week, month, issuetype, request type, etc. The ability to group by parts of dates (year, month, week, day, hour) or sprints is particularly useful here since it allows you to compare different time periods or see the trend. 

Average Status Duratipon Report with Filter Dates.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. It supports both Company Managed and Team Managed projects for Jira Cloud.

Time in Status reports can be accessed through its own reporting page, dashboard gadgets, and issue view screen tabs. All these options can provide both calculated data tables and charts.

Visit Timepiece - Time in Status for Jira to explore how our JIRA add-on can revolutionize your metrics measurement process. Enjoy a 30-day free trial to experience the full range of features. 

Hope it helps,

Gizem

0 votes
Mehmet A _Bloompeak_
Atlassian Partner
January 30, 2024

Hi @t m

Unfortunately, there is not a built-in solution in Jira to get time in status. If you prefer to use a marketplace app, you can try Status Time Reports app developed by our team. It mainly provides reports and gadgets based on how much time passed in each status. Your Jira admin can install this app.

Here is the online demo link, you can see it in action and try without installing the app. For your case, you can have a look at Time in Status for Each Issue report. You can export your reports and filter the results in MS Excel.

For further details, you can have a look at Status Time Reports How to Videos.

  • This app has a dynamic status grouping feature so that you can generate various valuable reports as time in status, time in assignee, status entry dates and status counts, cycle time and lead time, resolution time, average/sum reports by any field(e.g. average in progress time by project, average cycle time by issue creation month).
  • You can search issues by Project, Issue Type, Status, Assignee, Issue Creation/Resolution Date(and any other Date field) and JQL Query.
  • Status durations are calculated according to the working calendar you define. Once you enter your working calendar into the app, it takes your working schedule into account too. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days.
  • You can set different duration formats.
  • You can also add this app as a gadget to your Jira dashboards and reach “Status Time” from Issue Detail page.
  • You can enable/disable access to Status Time reports&gadgets and Issue Detail page per project, users, groups or project role.

If you are looking for a completely free solution, you can try the limited version Status Time Reports Free.

Hope it helps.

Suggest an answer

Log in or Sign up to answer