I have a query that is something like this:
project in (X, Y) AND component in (A,B,C,...) AND labels not in ("stuff")
This filter returns less than expected. It filters the things with label "stuff", but also filters things with label = "EMPTY"
We fixed by changing the label stuff to: (labels != "stuff" OR labels is EMPTY)
However, it doesn't make sense to me that things without a label need to be specifically selected since "EMPTY" should not equate to "not stuff".
Am I missing something or is this a bug (or a feature)?
This is expected behavior. When you are searching on label != X it will only search on issues that have the labels set to something, and that is why you have to include labels is EMPTY as well. Same thing if you would have a search that excludes a component, you would then have to include the empty ones as well.
It's not weird, it's logical. Computers are logical engines, you have to be precise with them. Humans are not, we can make assumptions!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We agree on the end of your statement, but not the beginning. Computers are not so much logical as logic engines that have actions programmed by humans based on requirements. In this case, it's a database engine with a rudimentary programming language, JQL.
To illustrate my expectations, here's how I think of the problem: If I have a set of 10 marbles, some are swirled with the color blue, some red, and some just clear. If I ask you to "please give me all the marbles that are not blue", I'd expect you to give me the clear and red marbles, not just the red marbles.
However, I can also see how the programmer might have thought differently. Perhaps their design grabs all the things with labels and then returns the ones without the label I don't want. That might have been the requirement they worked to or it's a bug (I favor the latter).
Anyway, if I assume the former requirement, then it explains the results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So how do you answer the question "please give me all the marbles that are not blue" when you have some marbles where you don't know what colour they might be?
Logically, you can not. Humans assume, computers need clear rules.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no assumption being made. The request is made on the database which has numerous, known records. The URL I'm using to access our Jira database provides the context of what records to query.
If I make a simple JQL query such as: "labels in (BLUE, RED)", it selects all records in the database that match that have those labels. It's only problematic when I ask "labels != BLUE"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But how can you tell that a marble that you can not see is of a certain colour?
Simple answer, you can not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead of
labels != stuff
labels not in (stuff, the_void)
use
# Select ticket if missing the named label.
NOT (labels = stuff)
# Select ticket if missing ANY of the named labels.
NOT (labels = stuff AND labels = the_void)
# Select ticket only if missing ALL of the named labels.
NOT (labels in (stuff, the_void))
These avoid having to check whether labels IS EMPTY.
Note: labels != stuff excludes when labels IS EMPTY, but NOT (labels = stuff) includes it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just tested it in my Jira instance, and `NOT (labels = stuff)` does actually exclude issues where labels is EMPTY. Seems like the only way is to do an OR, like `(labels!=stuff OR labels is EMPTY)`
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.