JQL query for issues in a status for longer than 30 days

Deleted user May 27, 2021

Can someone help me with a query to pull all stories that have been in a certain status longer than 30 days?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

16 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2021

Hi @[deleted]  -- Welcome to the Atlassian Community!

I believe this will do what you ask.  Please substitute your project and status names.

project = myProject AND status = myStatus AND NOT status CHANGED AFTER -30d

And, please look here for more information about advanced JQL searching:

https://support.atlassian.com/jira-software-cloud/docs/use-advanced-search-with-jira-query-language-jql/


Best regards,

Bill

Deleted user May 27, 2021

Awesome!! That did the trick! I appreciate your help :)Thank you!!

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2021

Jennifer, I am glad to hear that helped you!

And as an FYI, we use quick filters like this to help our teams using company-managed projects (classic) who have a lot of work in progress (WIP).  Checking during the stand-up for things that haven't moved in a while can help start useful discussions.  Such as: NOT CHANGED AFTER -3d

__Bill

Like Arensa Prasta likes this
Paul Stasiak August 4, 2021

Praise you, Bill. This worked finally. Not sure why this is so hard and everything is only made easier by a plug-in. Some of us can't get project funding for plug-ins. This is great.

Like # people like this
Barış Baysal November 3, 2022

Hello All,
This is good , my question is can I perform the same query for issues which have stalled in the same status (for a certain amount of time) at some point in time? so it does not necessarily need to be in "that" status as of now. 
Any suggestions? Thank you

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2022

Hi @Barış Baysal 

Mostly, in a few ways...You can do is check if the status did not change DURING a window of time:

project = myProjectName AND NOT status CHANGED DURING (date1, date2)

You could also use the AFTER or BEFORE operators, if those would better match your needs.

You may also use the relative date functions, such as startOfYear(), in place of date1 and date2: https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/ 

Kind regards,
Bill

Like # people like this
tvishakha May 14, 2023

Thanks @Bill Sheboy it was very helpful

Like Bill Sheboy likes this
Troy September 2, 2024

Hi  @Bill Sheboy hope you doing well.

So using your JQL I was able to display all Stories & Defects that have been in progress for 2 weeks or more like below, which is great.

project = AB AND type in (Defect, Story) AND status = "In Progress" AND NOT status changed after -2w ORDER BY created DESC

My question is can I display against each ticket specifically how long it's been blocked for? Happy to create a separate thread on this, if you want me to.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2024

Hi @Troy 

Sorry for the delay in responding as I have been offline for a few weeks.

Regarding "blocked", if you mean the Flag feature for issues, that time cannot easily be found with out-of-the-box features.  You could create an automation rule to detect and record the start of blocked date / time, and then use JQL to to test it (or another rule to report it).  Or, as others have described, you could try a marketplace addon / app.

If instead you have a "blocked" status, the built-in control chart could help...although that has several limitations / problems for reporting.  (And...I recommend not creating a status of "blocked" as it normalizes the condition of blocking for a team, rather than making it an exception to flow.)

Kind regards,
Bill

Like Troy likes this
0 votes
Vero Rivas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2021

Hi @[deleted] 

   Tell us how you want to do the query with what data, even with false information to help you, maybe something like this

    Issuetype = "HU" and status = XXX and createddate >= 30

Cheers

Deleted user May 27, 2021

That doesnt seem to work- I need to pull all stories, bugs, etc. in a project that have been in the "UAT" column for greater than 30 days

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events