Searching for Epics without a component

Jira Admin January 11, 2017

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

1 answer

1 accepted

2 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2017

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"

Jira Admin January 11, 2017

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!

Like jmn likes this
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2017

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) )

Jira Admin January 12, 2017

Hello,

This is the answer here.

Thanks for your help

JRob January 16, 2017

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))

 

 

JRob January 16, 2017

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)
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 16, 2017

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"

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 16, 2017

Ah, comments crossed over.  You've spotted what I was explaining.

Suggest an answer

Log in or Sign up to answer