JQL Filter Issue

Josh Velez April 14, 2021

I currently have this JQL for a board

Team = 5314 AND issuetype not in subTaskIssueTypes() AND issuetype != Risk AND (Status != complete OR status changed to Complete after startOfDay(-25) ) ORDER BY Rank ASC

 I am trying to also inject a new issue type that is in working status or expected delivery within 30 days

1 answer

0 votes
John Funk
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 14, 2021

Hi Josh,

I would start by adding one element at a time see what works and when it doesn't return the results you want, and then tweak from there. 

Josh Velez April 14, 2021

Thats what I have been doing and why I'm here now asking for help

John Funk
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 14, 2021

Very good - where is it breaking down for you? At what point/element does it not provide what you need? Do you get an error? Or it just doesn't return the right results? 

Josh Velez April 14, 2021

The JQL in the code returns fine just when I try to add the second issue type the board times out.

John Funk
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 14, 2021

So exactly which part of the code is working with no problems? 

Josh Velez April 14, 2021

The entire code posted is working fine

Josh Velez April 14, 2021
Team = 5314 AND issuetype not in subTaskIssueTypes() AND issuetype != Risk AND (Status != complete OR status changed to Complete after startOfDay(-25)) OR issuetype = CDRL AND Status != "In Progress" AND ("Expected Delivery Date" >= startOfDay(30d)) ORDER BY issuetype DESC, Rank ASC

 

So this is what I have right now but the expected delivery date is not filtering out correctly. Its just show all CDRL issue types

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.
April 14, 2021

Hi @Josh Velez 

I believe you have an order of precedence thing happening with the OR clause.  Have you tried wrapping the two things you want in parentheses to clarify the OR condition?

Is this what you were trying to query?

Team = 5314
AND
(
(
issuetype NOT IN subTaskIssueTypes()
AND issuetype != Risk
AND (
Status != complete
OR status CHANGED TO Complete AFTER startOfDay(-25)
)
)
OR
(
issuetype = CDRL
AND Status != "In Progress"
AND "Expected Delivery Date" >= startOfDay(30d)
)
)
ORDER BY issuetype DESC, Rank ASC


Best regards,

Bill

Josh Velez April 14, 2021

So this didnt work. I have the two separate JQLs returning properly but when I combine them it doesnt work.

 

Team = 5314 AND (issuetype NOT IN subTaskIssueTypes() AND issuetype != Risk AND (Status != complete OR status CHANGED TO Complete AFTER startOfDay(-25)))
Team = 5314 AND (issuetype = CDRL AND Status != "In Progress" AND "Expected Delivery Date" <= startOfMonth(30d)) 
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.
April 14, 2021

One more thing to try: completely separate the queries and then OR the result sets.

(
Team = 5314
AND issuetype NOT IN subTaskIssueTypes()
AND issuetype != Risk
AND (
Status != complete
OR status CHANGED TO Complete AFTER startOfDay(-25)
)
)
OR
(
 Team = 5314
AND issuetype = CDRL
AND Status != "In Progress"
AND "Expected Delivery Date" >= startOfDay(30d)
)
ORDER BY issuetype DESC, Rank ASC

 

Like John Funk likes this
Josh Velez April 16, 2021

Still not working idk what the issue is when the two JQL are separate they work fine

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.
April 16, 2021

Thanks, Josh.  At this point I think you have two options:

  1. If you only needed this one time, run the queries separately and merge the results in a spreadsheet after exporting
  2. If you regularly need this query, talk to your site admin to submit a support request to Atlassian.  Perhaps the support team will see something the community is missing.  https://support.atlassian.com/contact/#/

Best regards,

Bill

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer