JQL to find issues which are specific time in status

Sidney Mätzke May 16, 2024

Hey, I need to find all issues which are in Status "A" for exactly 21 days from now.

So if the issue is in status "A" for 20 or 22 Days, the JQL should exclude these issues.

It probably is some JQL with "Not status changed after/during/to..."

Can someone tell me the correct JQL?

Thanks in advance!

 

1 answer

2 votes
Jerrold - Empyra
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 16, 2024

Hi @Sidney Mätzke 

Can you try this JQL 

status = Closed AND status changed to "Closed" AFTER -21d AND status changed to "Closed" BEFORE -20d

Thank you

Sidney Mätzke May 16, 2024

Hi @Jerrold - Empyra

Thanks for your reply. Normally this JQL works, but this JQL shows also issues which has been for 21 days in this status in the past. So I need a JQL which shows only issues that are in a status for 21 days from now. I hope thats comprehensible.

Jerrold - Empyra
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 16, 2024

Hi @Sidney Mätzke 

Ok can you try this one 

status = Closed AND status changed to "Closed" AFTER startOfDay(-21) AND status changed to "Closed" BEFORE startOfDay(-20)

Thank you.

Sidney Mätzke May 16, 2024

Hi @Jerrold - Empyra 

thank you, but sadly it's the same result. It still shows issues which has been for 21 days in this status at some time. Do you have another suggestion?

Jerrold - Empyra
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 16, 2024

Hi @Sidney Mätzke 

I am really sorry that it didn't work I am not able to test the JQL in my test instance as i don't have issues in a status for  21 days I hope this JQL works 

status = "In Progress" AND status CHANGED TO "In Progress" ON -21d AND status CHANGED AFTER startOfDay(-1)

or 

status = Closed AND status changed TO "closed" ON -21d AND status changed BEFORE -20d

Thank you

Sidney Mätzke May 17, 2024

Hi @Jerrold - Empyra 

thanks, the last suggestion was good, but we had to add a part at the end to exclude issues that changed to another status during these 21d and then back again to the original status. 

So this is the JQL that worked for us.

(status = Closed AND status changed TO "closed" ON -21d AND status changed BEFORE -20d) AND not status changed AFTER -21d

Like Jerrold - Empyra likes this

Suggest an answer

Log in or Sign up to answer