-
Suggestion
-
Resolution: Unresolved
-
41
-
88
-
NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.
Expected Behavior
The NOT / != operator in a JQL query should return issues with no value set for the searched field or with an empty value.
Actual Behavior
Issues with non-existing or empty values for the searched field are excluded from the search.
Example #1
- I have the below query on a filter, which returns all issues not assigned to the user admin;
assignee != admin
- This filter returns issues assigned to all users but admin, however it doesn't return unassigned
Example #2
- A JIRA instance has 100 issues;
- 90 issues are under a issue type which should have a field named "Color";
- 80 of those issues have a value for the "Color" field;
- 30 of those 80 issues have the color set to "Red";
- The below query returns 50 issues, whereas it should return 70 issues based on the logical value of !=, which is "not equals to", what should imply "empty" or "null";
Color != "Red"
Example #3
- Below query, should returns all issues with fixVersion not equals to 2.
fixVersion not in (2)
- but it doesn't return issues with EMPTY values in fixVersion
- Proper JQL query is, which is not intuitive:
fixVersion not in (2) or fixVersion is EMPTY
- Taking into account that IN is alias to (= OR , ...)
Example #4
- Below query, should return all issues with an empty Epic link.
("Epic Link" is empty or "Epic Link" != <>
- but it doesn't return all the issues with EMPTY values
Steps to Reproduce
- Run a filter similar to the below;
assignee != admin
- Un-assign one of the issues returned by the filter;
- Re-run the search;
Notice the unassigned issue will be now be missing.
Workaround
Create a filter for issues which have a positive match for the value you are trying to exclude.
Example
- Create a new filter with the below query and give it a name (e.g. Admin's Issues)
assignee = admin
- Run a search with the below query;
filter != "Admin's Issues"
Workaround 2
Why my JQL search with “not in” or “!=” (not equals) operators has issues missing
Testing Notes
Using Luke to query the Lucene index directly and searching for -color:red you get 70 issues on the use-case presented above (in "Example #1", under "Actual Behavior").
- is duplicated by
-
JRACLOUD-29179 When searching for Issues, negative filtering does not return empty values
- Closed
-
JRACLOUD-75831 The JQL search doesn't return issues with empty values in the "Epic Link" field when using the clause "Epic Link" !='
- Closed
-
JRACLOUD-28777 Filter with !~ or "not in" does not consider empty fields or Resolution "Unresolved"
- Closed
-
JRACLOUD-33000 Improve JQL or Issue Navigator to handle Logic
- Closed
-
JRACLOUD-47747 When using category not in it excludes projects with no category value.
- Closed
- is related to
-
JRASERVER-23030 Not equals operator (!=) excludes results with empty values
- Closed
-
JRASERVER-61841 JQL behavior for "not in" doesn't include empty list
- Closed
-
JRACLOUD-61841 JQL behavior for "not in" doesn't include empty list
- Gathering Interest
-
JRACLOUD-85082 Basic search behaviour for "not in" does not include results with empty values
- Gathering Interest
- relates to
-
JRACLOUD-73640 JQL issueLinkType is inconsistent when using != or NOT IN operators
- Closed