JQL Produces Error rather than 0 result

James Park January 10, 2022

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

James Park January 10, 2022

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

James Park January 13, 2022

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