-
Suggestion
-
Resolution: Unresolved
-
1
-
13
-
NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.
We're searching for issues that don't have labels in a specified list.
At first we used this query:
project = BLAHBLAHBLAH and (labels not in (bucket-1, bucket-2, bucket-3))
And we were pleasantly surprised to find only 16 issues, which we reviewed and triaged.
Then we got a report from a developer saying there were a bunch of issues we missed.
I had a hunch and tried this query:
project = BLAHBLAHBLAH and (labels not in (bucket-1, bucket-2, bucket-3) or labels is empty)
Sure enough there were over 600 items returned.
Somehow the NOT IN keyword doesn't take into account null values. This needs to be clearly documented. It probably makes sense at the SQL level but it is totally counterintuitive at the end-user level.
Notes
This is expected behaviour but continues to cause confusion so this ticket should remain open.
Documented here: JQL operators
Note that typing field != value is the same as typing NOT field = value, and that field != EMPTY is the same as field IS_NOT EMPTY.
- is related to
-
JRASERVER-61841 JQL behavior for "not in" doesn't include empty list
- Closed
-
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
-
JRACLOUD-23030 Not equals operator (!=) excludes results with empty values in JQL
- Gathering Interest