Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JQL Produces Error rather than 0 result

Hello Attlassian,

I will need your help.

The following JQL will produce error rather than producing zero result.

field1 is a dropdown menu field and the value "XXXXX" does not exist.

JQL:

project="project1" AND field1 = "XXXXX"

 

I will need to use logical express OR to see if the value "XXXXX" exist in either project.

(project="project1" AND field1 = "XXXXX") or (project="project2" AND field2="XXXXX")

 

This JQL produces error. How do I go about searching for "XXXXX" in the fields (dropdown) when I do not even know if the value exist in either of the fields?

1 answer

0 votes
Jack Brickey Community Leader Jan 10, 2022

You can't search for a value that doesn't exist as an option in the drop down.

example...

let's say field ABC has the following options: Fred, Barney, Wilma, Betty but it does not have the option of Pebbles.

if you use "ABC = Pebbles" you will get an error because Pebbles is not within the drop down context.

however you could use "ABC not in (Fred, Barney, Wilma, Betty)" and you will receive 0 results. This is because you have queried to find all issues where the field ABC has a value other than any allowed value which will always return 0. 

does this make sense?

Yes, it does. If that is how the logic flows with dropdown menus in JIRA then I guess that I am stuck.

 

Then, how can I use your mentioned "ABC not in (Fred, Barney, Wilma, Betty)" with logical expressions to list the JIRA tickets that contains "ABC" where I do not know if "ABC" exists as options in the dropdown fields that I am searching into?

 

For example, how can I use "NOT IN" to get the result below?

(project="project1" AND field1 = "ABC") or (project="project2" AND field2="ABC")

Jack Brickey Community Leader Jan 10, 2022

You need to go to admin > issues > custom fields, click the ellipses for the field and select contexts. In that screen you will find all values for that field. Alternatively, as you enter that JQL I mentioned the Advanced search will offer all available options.

With that said I am a bit perplexed by your use case and unsure why you need what you are asking.

I have many projects in JIRA that belong to many functions in our company. Your suggested method requires that I search all option lists of drop down menus for all possible fields. This is not doable. 

 

Each function in our company own its own JIRA project. They defined their own fields and option lists for drop down menus that contain product names (not standardized names). I am trying to find if a product name "ABC-DEF" exit in JIRA tickets. The problem is that I get error message because "ABC-DEF" does not exist in some option for some projects.

My logic is that I should be able to query using the logical expression "OR"

 

(project="project1" AND field1 = "ABC") or (project="project2" AND field2="ABC")

 

without encountering error.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

382 views 1 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you