Forums

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

Can someone tell me an easier way to write this JQL filter?

Richard
June 4, 2021

project = TUBI AND issuetype = "Work Request" AND "Closed Date" <= "2021/6/30" AND "Closed Date" >= "2021/6/1" AND "Implementation Date" < "2021/6/1" AND "Line of Business:" = "Wholesale Banking" OR "Closed Date" <= "2021/5/31" AND "Closed Date" >= "2021/5/1" AND "Implementation Date" < "2021/5/1" AND "Line of Business:" = "Wholesale Banking" OR "Closed Date" <= "2021/4/30" AND "Closed Date" >= "2021/4/1" AND "Implementation Date" < "2021/4/1" AND "Line of Business:" = "Wholesale Banking" OR "Closed Date" <= "2021/3/31" AND "Closed Date" >= "2021/3/1" AND "Implementation Date" < "2021/3/1" AND "Line of Business:" = "Wholesale Banking" OR "Closed Date" <= "2021/2/28" AND "Closed Date" >= "2021/2/1" AND "Implementation Date" < "2021/2/1" AND "Line of Business:" = "Wholesale Banking" OR "Closed Date" <= "2021/1/31" AND "Closed Date" >= "2021/1/1" AND "Implementation Date" < "2021/1/1" AND "Line of Business:" = "Wholesale Banking"

2 answers

2 accepted

3 votes
Answer accepted
JimmyVanAU
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 Champions.
June 4, 2021

Hi Richard,

I think the simplest it can be made is to use some parentheses:

project = TUBI AND type = "Work Request" AND "Line of Business:" = "Wholesale Banking" 
AND
( "Closed Date" <= "2021/6/30" AND "Closed Date" >= "2021/6/1" AND "Implementation Date" < "2021/6/1"
OR "Closed Date" <= "2021/5/31" AND "Closed Date" >= "2021/5/1" AND "Implementation Date" < "2021/5/1"
OR "Closed Date" <= "2021/4/30" AND "Closed Date" >= "2021/4/1" AND "Implementation Date" < "2021/4/1"
OR "Closed Date" <= "2021/3/31" AND "Closed Date" >= "2021/3/1" AND "Implementation Date" < "2021/3/1"
OR "Closed Date" <= "2021/2/28" AND "Closed Date" >= "2021/2/1" AND "Implementation Date" < "2021/2/1"
OR "Closed Date" <= "2021/1/31" AND "Closed Date" >= "2021/1/1" AND "Implementation Date" < "2021/1/1")

It looks like you're trying to see which issues were closed within one month of implementation.

One suggestion is to use Automation to identify issues which meet this criteria, e.g. with a label, or a custom field "Closed within one month of implementation". Not particularly a huge fan of custom fields with one purpose, but however, you tackle it is up to you.

You can use automation with a scheduled trigger (make it 5 minutes from  now), for all issues which meet this JQL criteria, then apply the change (new lable/custom field + value).

Your dashboard or filter will then be much neater.

 

If Closed Date is the same as resolution date (resolved field), then you could simplify the existing JQL using something like:

status WAS "Closed" DURING ("2021/2/1","2021/2/28") AND "Implementation Date" < "2021/1/1"

but I would still suggest you look into identifying the issue in another way. This will simplify your searches and scale for future months.

Cheers, Jimmy

3 votes
Answer accepted
John Funk
Community Champion
June 4, 2021

Hey Richard - Wow, that is quite the query. Can you just describe in words what you are wanting to see?

Jack Brickey
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 Champions.
June 4, 2021

Indeed that query seems impossible to maintain 

Like # people like this

Suggest an answer

Log in or Sign up to answer