JQL Query Question

Hi,

I'm having trouble with JQL. I want to create a JQL based on the built-in field "component", which has a list pre-defined values (e.g. HW, SW, ME). An issue's component field can have 0 to multiple values.

I want to create a query that searches for issues whose "component" field does NOT CONTAIN "SW" ALONE. For example, Issue 1's component field has "HW, SW", Issue 2's component field has "SW", and Issue 3's component field has no value. Issue 1 and issue 3 would be returned in such query.

How can I create such query using JQL? Thanks!

4 answers

0 votes

Try something like this?

component in ("SW") and component not in ("HW", "ME", ...)

Include all components other than SW in the second clause.

Thanks Jobin that's the approach we are taking right now. But if we add/change the values available for components, we need to update the query. And we actually have quite a bit more components values than I listed here. So I was hoping for a way to avoid listing all of them in the query

Can't think of anything else here :)

This will not eliminate single component names but it might help group the single component names together so you can visually skip over them.

component = SW ORDER BY component desc

Does this work?

project = x AND ( NOT (component IN ("SW")) OR component=Empty)

put the NOT outside the (component IN (x)) clause. Not sure why you also need the OR Empty part.

and  (not component in ("documentation", "research") OR component is empty)     

 

works

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,167 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