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 vote

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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

58 views 0 5
Read article

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