Forums

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

So I am working on a pretty Complex filter and for some reason It is not filtering at all

Preston Hicks
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!
December 3, 2021

Here is the JQL code I am Using:  project in ("Business Analytics") OR project in (IRR) And assignee is EMPTY AND statusCategory not in (Done) AND "Department[Short text]" ~ "Orientation & Student Success" OR "Department[Short text]" ~ "Diversity and Multicultural Affairs" OR "Department[Short text]" ~ "Career Services" OR "Department[Short text]" ~ "Academic Advising" OR "Department[Short text]" ~ "Thayne Center for Student Life, Leadership & Community Engagement" OR "Department[Short text]" ~ "TRIO & PACE Programs" AND labels in (internal-request, External-Request) AND reporter = 5b688af7304ed93c17e41c98   

 

For some reason it is Including Done and Assigned tickets,  Which the code above filters out  I am unable to share screenshots.  Is there anything wrong with the code up above that would be causing this, The reason why I'm not just clicking the Status Tab is because the code will be for a rally bot notification 

3 answers

1 accepted

5 votes
Answer accepted
Alex
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.
December 3, 2021

Hi @Preston Hicks, and welcome to the community!

 

Based on your JQL, I am assuming you need to list issues within the following criteria:

  • Project in (Business Analytics ) OR
  • Project in (IRR ) AND
  • assignee = empty
  • statusCategory not in Done AND
  • Department[Short text] in (...)
  • labels in (internal-request, External-Request) AND
  • reporter = 5b688af7304ed93c17e41c98

If that is the case, you might need to add a couple of parentheses to complete the logic.

Ex:

project in ("Business Analytics") OR 
(project in (IRR) AND
assignee is EMPTY AND
statusCategory not in (Done) AND
("Department[Short text]" ~ "Orientation & Student Success" OR
"Department[Short text]" ~ "Diversity and Multicultural Affairs" OR
"Department[Short text]" ~ "Career Services" OR
"Department[Short text]" ~ "Academic Advising" OR
"Department[Short text]" ~ "Thayne Center for Student Life, Leadership & Community Engagement" OR
"Department[Short text]" ~ "TRIO & PACE Programs") AND
labels in (internal-request, External-Request) AND
reporter = 5b688af7304ed93c17e41c98 )

 

If your criteria are different, please share them so that I can think through them.

I hope it helps. If this answer helps solve the problem, please come back and mark this answer as solved to help other community members with the same challenge. If not, you are welcome to share your solution as well.

Cheers,

Alex

Preston Hicks
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!
December 3, 2021

Thanks That slimmed it done by alot

1 vote
Robert Wen_Cprime_
Community Champion
December 3, 2021

hello @Preston Hicks !  Welcome to the Atlassian Community!

A couple of things I can see.

You can use in as an "implicit OR" to simplify a few things.

Some of these should probably be grouped together inside parentheses.  I think that's what's going on with your JQL and the logic.

Here's my cleanup:

project in ("Business Analytics", IRR)  AND assignee is EMPTY AND statusCategory != Done AND ("Department[Short text]" ~ "Orientation & Student Success" OR "Department[Short text]" ~ "Diversity and Multicultural Affairs" OR "Department[Short text]" ~ "Career Services" OR "Department[Short text]" ~ "Academic Advising" OR "Department[Short text]" ~ "Thayne Center for Student Life, Leadership & Community Engagement" OR "Department[Short text]" ~ "TRIO & PACE Programs") AND labels in (internal-request, External-Request) AND reporter = 5b688af7304ed93c17e41c98   

 

Good luck!

1 vote
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.
December 3, 2021

Hi @Preston Hicks -- Welcome to the Atlassian Community!

For a query like that, try splitting it apart and rebuilding it incrementally.  I suspect you have an order of precedence problem with your AND and OR expressions.

  • List all of the things true for everything you expect first
    • something AND somethingElse AND oneMoreThing
  • To ensure correct precedence, try formatting to separate the AND and OR clauses using parentheses
    • something AND somethingElse AND oneMoreThing AND (idea OR otherIdea)
  • For multiple cases, pick one of the cases, and get it working...
  • Wrap that with parentheses...
  • And then add the next case, also wrapped with parentheses

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events