I've been trying to figure out why some issues aren't appearing in a search results set, as I would expect - and I came across the following bizarre search results that I'm having trouble figuring out:
project = C2C 934
project = C2C AND Sprint = 13542 61
project = C2C AND Sprint != 13542 328
Not to state the obvious, but the combined results of queries 2 and 3 should equal the results of query 1 - but aren't even close.
Why would this be happening? It seems like an issue in the project should either be in Sprint 13542 or not in Sprint 13542 - but these results imply there are quite a few issues that don't fit either category.
Hi Justin and welcome,
At first JQL can be really tricky, just an example:
project = C2C AND Sprint != 13542
Above filters means any issue on project C2C having an Sprint set different from 13542
project = C2C AND ( Sprint != 13542 OR Sprint is EMPTY)
What you are really looking for! Any issue on project C2C having any Sprint set different from 13542 or not having Sprint at all.
I suspect you'll find the missing items have no sprint.
It's an odd point of logic that humans get wrong all the time (totally understandably, it's just not the way we think)
Let's translate those clauses into plain English and expand on it
Project = C2C - "The issue is in project C2C"
And Sprint = 13542 - "and in sprint 1352"
Those two work fine for both the computer and the human, the sticking point is that humans drop the part of the question a computer needs when you ask
and sprint != 13542 - this looks like "the sprint field is not 13542", but there's a hole. If the field is empty, it's not not 13542, it's not anything at all. The logic has nothing to compare with. So it doesn't find it If the field is null, you cannot actuall say that it is not 13542, because you don't have anything to look at.
The way the human brain tends to process "not" is logically incorrect.
Anyway, I would expect this to do what you expect:
project = C2C AND (Sprint != 13542 or Sprint is empty)
Not really, think of java as an obvious example:
It is logically obscure, but it has uses. In coding terms, it is often very important to understand that a yes/no question has three possible responses.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events