JQL to exclude values from customfield select-list

felix.weber December 9, 2021

Hi

we have a custom-field containing several domains: CompanyDomains

lets assume they are named like;

"domainA - websiteX"; domainB - websiteY"; "domainC - websiteZ"

 

I want to exclude all websites related to "domainC" in the results.

CompanyDomains !~ "DomainC*" => but does not work

So wanted to say like exclude all domains starting with DomainC

 

"DOES NOT CONTAIN: !~" is not working because its only used for text searches (IF I understand the documentation correct) - see https://support.atlassian.com/jira-service-management-cloud/docs/advanced-search-reference-jql-operators/#Advancedsearchingoperatorsreference-DOES

 

any suggestions ? 

 

3 answers

0 votes
mauricio.groth
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.
April 22, 2022

Hi, @felix.weber 

 

As you're on Jira Cloud, the correct answer is to get an app that provides JQL extensions you're looking for.

With standard JQL, you can only get a list of issues and export them to Excel for further processing. This works if you want to do a one-off analysis. If your use case is more dynamic than that, look beyond standard Jira.

Standard JQL doesn't easily allow it, but you can quickly find the results using our professional indexing service JQL Search Extensions

After you install the app, you can use this query:

issue in wildcardMatch("CompanyDomains", "domainC*")

And then, you save it, in “Save the query as a filter”.

For example, you put the name of the filter as ”WithoutDomainC”

After this, you access the Advanced issue Search, in Jira and use this query:

filter != "WithoutDomainC"

Check out the documentation for more examples.

I hope this helps!

Maurício

0 votes
felix.weber December 9, 2021

maybe another approach:

 

There are more conditions we are checking so we have several IF / ELSE blocks:

However if I put the condition on top the approval will be skipped even when a website from DomainC and any website from DomainA or DomainB is selected.

CompanyDomains IN (DomainC - WebsiteA, DomainC - Website B ....)

So I am struggling for the correct JQL for ONLY those websites :/ 

 

websites of DomainC = no approval

websites of DomainA & B requires approval

 

only websites from DomainC are selected => no approval

websites selected from DomainC & DomainA/B => approval

only Websites from DomainA/B => approval

 

not sure if you can follow - meanwhile spent to much time on this topic and maybe can´t explain myself anymore correctly ^^

0 votes
Sebastian Krzewiński
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2021

Hi  @felix.weber 

 

For select list field you should use "not in" operator and list all values that you want exclude.

Please check this doc - https://jirasupport.files.wordpress.com/2019/07/atlassian-jql-cheat-sheet-2.pdf

 

Regards,

Seba

felix.weber December 9, 2021

hi thanks - totally forgot about this cheat sheet - thanks

problem here: I would need to select plenty of domains manually - which is very sad - are you aware of any solution using wildcards ? 

so I guess my problem is more related to the wildcards for the select-list field

 

most documentation I found relates to text-fields 

Sebastian Krzewiński
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2021

Based on this wildcards don't works for any other field than text field. I found issue which is not resolved about this - https://jira.atlassian.com/browse/JRASERVER-43398

felix.weber December 9, 2021

thanks for this as well :/ 

Like Sebastian Krzewiński likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events