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

Muhammad Moazzam Hassan 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

4 votes
Answer accepted
Tessa Tuteleers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 April 11, 2023

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

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

That JQL is awesome :)

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

Thanks for the great answer.

Like Tessa Tuteleers likes this
Rick Robinson-Donnellan 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.

0 votes
Jared Kells 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
Site Admin
TAGS
AUG Leaders

Atlassian Community Events