Searching for Epics without a component

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

1 votes

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!

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

Hello,

This is the answer here.

Thanks for your help

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

 

 

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)

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"

 

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

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,104 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot