Forums

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

JQL for issue in status for last 3 or more business days

Muhammad Moazzam Hassan
Contributor
April 11, 2023

Hi,

I need the JQL query for getting those issues that are currently in certain status for the last 3 or more business days.

2 answers

1 accepted

7 votes
Answer accepted
Tessa Tuteleers
Community Champion
April 11, 2023

Hi @Muhammad Moazzam Hassan , 

If you didn't use business days, your query would look like this: 

status = "In Progress" AND status changed TO "In Progress" BEFORE -3d 

 

JQL does not have a "business day" concept, but you have weeks and days, if you want to, you could make calculations for your 3 business days (using the weekends as non-business days, not another schedule you define yourself).
I found another question describing this here

It would look like this: 

status = "In Progress" AND ((status changed TO "In Progress" BEFORE -3d AND status changed TO "In Progress" AFTER startofWeek()) OR status changed TO "In Progress" BEFORE -5d)

-> Meaning if 3 days ago was before the start of the week, count 5 days back instead of three (accounting for 2 weekend days)

Hope it helps! 

- Tessa

Muhammad Moazzam Hassan
Contributor
April 11, 2023

Thanks, let me test it and will get back to you

Like Jodi-Ann Rowe likes this
Jared Kells
Contributor
April 11, 2023

That JQL is awesome :)

Like Tessa Tuteleers likes this
Muhammad Moazzam Hassan
Contributor
April 13, 2023

Thanks for the great answer.

Like Tessa Tuteleers likes this
Rick Robinson-Donnellan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2023

This answered my issue as well, thanks Tessa.

Modified mine slightly to produce a list of tickets not updated in longer than 3 business days.

Like Tessa Tuteleers likes this
Qiang He
Contributor
November 19, 2024

everything should be good. Thanks.

0 votes
Jared Kells
Contributor
April 11, 2023

I'm not sure if it's possible to run JQL queries related that respect business days with plain JQL. There are add-ons that can do more sophisticated queries.

If you drop the business days requirement you could use something like: 

status = 'in progress' AND status changed to 'in progress' before -3d

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events