Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to reference EXACT 'list' configuration (equals operator)?

Lucas Molenaar
Contributor
September 24, 2021

I want to locate tickets that have a specific list selection. The tickets MUST have the exact configuration (so only one value match is not sufficient).

e.g. we have a custom field of type list named "platform", with 100 options (option1, option2, option3, ..)

I like to return all issues with

project = TEST AND issuetype = Bug AND platform = (option11, option61, option99)

When I use the = operator, I get the following error:

Operator '=' does not support the list value '("option11", "option61", "option99")' for field 'platform'.

What is the right syntax to return issues with the exact queried list configuration?

2 answers

2 votes
Jack Brickey
Community Champion
September 24, 2021

Use the “in” operator…

project = TEST AND issuetype = Bug AND platform in (option11, option61, option99)

Lucas Molenaar
Contributor
September 24, 2021

This also returns:
(option11, option61)
(option11)

The tickets MUST have the exact configuration (so only one value match is not sufficient).

Jack Brickey
Community Champion
September 24, 2021

project = TEST AND issuetype = Bug AND platform = option11 and platform = option61 and platform = option99

however, this will not exclude issues that also include additional platform values. There isn’t an “only =“ function.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2021

Hi @Lucas Molenaar 

Yes, and...to what Jack suggests: How often do you need to perform this query?

If you need it once, you could brute force it, by adding a clause to exclude all of the other options:

... AND platform NOT IN (option1, option2, ...)

Or, export to a spreadsheet to prune the list by option count.

If you instead need this often, you could investigate the marketplace for JQL addon apps which support such query syntax, or you could build an automation rule to do this.  (Such a rule would perform your query, and then check for issues with a count of options exactly equal to 3.  I've never built such a rule but I suspect it is possible.)

Kind regards,
Bill

Like Lucas Molenaar likes this
Lucas Molenaar
Contributor
October 4, 2021

Thanks for trying Jack but you either misread/misunderstand my question :)

Thanks Bill, seems indeed that I need to find an alternative method as this not supported (I need to run it often as part of dashboard filters.)

Like Jack Brickey likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2021

Hey Lucas,

As you need this often, you could still do this by adding a custom field and using an automation rule.  For example, create a custom field which contains the concatenated list of options, updated at issue create (or field change).  Your JQL could then check for an *exact* match for dashboard display:

project = TEST
AND issuetype = Bug
AND "Platforms Selected" = "option11, option61, option99"

The smart value to set your code would be something like:

{{issue.platform.name.join(", ")}}

0 votes
Daniel Turczanski - JQL Search Extensions
Atlassian Partner
October 14, 2021

If the options follow a pattern, you may find our regex JQL function handy to filter out issues with additional options. It's part of JQL Search Extensions.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events