Forums

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

Search for issues: JQL not caught

Sara V. October 25, 2022

Hi everyone! 

I would like to create a filter, and I've inserted the following code in the advanced research:

JQL code.JPGAs you can see in the attached screenshot, the code seems to be accepted.

However on checking I can still see the customized icon CI and WG. 

@lucale 

Thank you in advance!

1 answer

1 accepted

4 votes
Answer accepted
Walter Buggenhout
Community Champion
October 25, 2022

Hi @Sara V.,

Yes. The way you put things here, the OR part is basically ensuring that all issues are returned:

Issuetype != CI

will return all issue types in your Jira instance apart from CI (so also WG).

Issuetype != WG

will return all issue types in your Jira instance apart from WG (so also CI).

Assuming that you want to return all issues that are not CI and not WG, try the following instead:

category = "System Design" AND issuetype NOT IN (CI, WG)

Hope this helps!

Sara V. October 25, 2022

Thank you @Walter Buggenhout !

I had already tried the AND operator, but without changing the 'format' of the sentence. Now it works! 

Thank you :) 

Sara V. October 25, 2022

Sorry and if I wanted to add that, in addition of having issuetype different from CI and WG, I also want all those in the 'system design' that have the custom field 'project platform' different from 'POC', I should write the code like this:

code.JPG?

because it does not take it correctly.

Walter Buggenhout
Community Champion
October 25, 2022

Depends what the desired result needs to be, @Sara V.. As soon as you start using OR in your JQL, you need to make sure to use parentheses in the right places to get the desired results:

category = "System Design" AND issuetype NOT IN (CI, WG) AND
"Project Platform" != POC

would return all issues from system design projects that or not CI or WG issue types and on top of that do not have the value POC for Project Platform

category = "System Design" AND issuetype NOT IN (CI, WG) AND
"Project Platform" != POC

would return all issues from system design projects that or not CI or WG issue types and on top of that do not have the value POC for Project Platform

category = "System Design" AND (issuetype NOT IN (CI, WG) OR
"Project Platform" != POC)

because of the placement of your parentheses will return issuetypes CI and WG again. Whereas:

(category = "System Design" AND issuetype NOT IN (CI, WG)) OR
"Project Platform" != POC

will even return issues from other projects, again simply because of where you put your parentheses.

And, to make things even more exciting: if you search for custom field values, Jira also has a tendency to ignore empty values in that search. You might even need to do something like this:

category = "System Design" AND issuetype NOT IN (CI, WG) AND
"Project Platform" != POC AND "Project Platform" is NOT EMPTY

That last example goes back to the first scenario here, because I assume that's most likely what you want to achieve. If you do want empty values to be returned, that would become something like this:

category = "System Design" AND issuetype NOT IN (CI, WG) AND
("Project Platform" != POC OR "Project Platform" is EMPTY)

Note the placement of the parentheses here as well as the use of OR, because I am combining different criteria for the same field.

Like Sara V. likes this
Sara V. October 25, 2022

@Walter Buggenhout thank you! 

I am not an expert of JQL code,

Thank you very much for the explanation: super super clear!

Like Walter Buggenhout likes this
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.
October 25, 2022

Hi @Sara V. 

Adding to Walter's answer...There is some free, online training from Atlassian on JQL, such as this class below:

https://university.atlassian.com/student/path/849533-gain-project-insights-through-jql

This one helps to learn how you might answer project questions using JQL.

Kind regards,
Bill

Like Sara V. likes this

Suggest an answer

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

Atlassian Community Events