Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello,
We are trying to search for all Epics not having a specific component, but no result is returned even if none of them have that component.
We are using the following query :
Project = MyProject and type in (Epic) AND component not in (MyComponent)
If we take off the component part of the query, I get can see all of the Epics. What are we doing wrong here?
Thanks,
Edit : Misleading words in JQL + Added Code block
Ah, yes, human language lets us down a little here. "component not in <complete list>" is logically not the same as "no component". The way we think in a more fuzzy logic than computers falsely equates the two ideas.
The first one is implying that you're looking for a specific component, so an issue has to have one for the query to work. Then you're saying "the component found must not be in a list of <all>". So you then rule them all out.
Try
Project = PROJECT and type in (Epic) AND component is empty
You'll notice that is not looking for "issues with components", the language is specifically "no component set"
Hello,
Sorry, I think the way I wrote my example was misleading. I should have wrote :
Project = MyProject and type in (Epic) AND component not in (MyComponent)
Basically what I'm trying to achieve, is list all Epics that have not a specific component (MyComponent) as a component.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's at least half my fault for not reading your question properly. Probably all my fault.
My explanation stands, but only gets you halfway there. The query certainly only gets you half an answer. Try:Project = MyProject and type in (Epic) AND (component is empty OR component not in (MyComponent)
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would expect this to be a tautology:
A OR NOT A
Why is it that the following doesn't return all results?
component IN (a, b, c) OR component NOT IN (a, b, c)
Or even...
(component IN (a, b, c)) OR !(component IN (a, b, c))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've learned that jql does not check for empty automatically for you. So whenever you use a query like:
component NOT IN (a, b, c) AND "Epic Link" NOT IN (d, e, f) AND labels NOT IN (g, h, i)
You need to add the IS EMPTY to your query.
(component IS EMPTY OR component NOT IN (a, b, c)) AND ("Epic Link" IS EMPTY OR "Epic Link" NOT IN (d, e, f)) AND (labels IS EMPTY OR labels NOT IN (g, h, i))
Interestingly, doing a negation of an IN clause has the exact same problem
component IN (a, b, c) != !(component IN (a, b, c))
You still need to add the IS EMPTY check
component IN (a, b, c) == component IS EMPTY OR !(component IN (a, b, c)) == component IS EMPTY OR component NOT IN (a, b, c)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's explained above, but let's try it again. You're ignoring the third answer to the question of "not answered". Is <not answered> in (a, b, c)? You can't tell because you don't have an answer. You need to explicitly catch "empty", because it's not the same as "look for empty in a fixed list"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, comments crossed over. You've spotted what I was explaining.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.