Forums

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

JQL wildcard search on Select List (multiple choices) field type

Cory Beck
Contributor
July 18, 2019

My goal is to run a JQL search on a single Jira project and a Select List custom field that contains a list of our Jira projects. We'll call the project I am trying to search "123", the custom field I'm trying to search is called "JIRA Project(s)". "JIRA Project(s)" contains a list of 300+ Jira projects, about 30 of which contain "ABC" in the project name. I have already verified several issues in project 123 have a "JIRA Project(s)" value of 123.  I have scriptrunner to utilize. I think I am close but I either get a regex error or the JQL falsely returns no results.

Will not work

  1. project= 123 AND "JIRA Project(s)" ~ ABC*

Falsely returns no results 

  1. issueFunction in issueFieldMatch("project = 123", "JIRA Project(s)", "^ABC.*")
  2. issueFunction in issueFieldMatch("project = 123", "JIRA Project(s)", "^ABC*")
  3. issueFunction in issueFieldMatch("project = 123", "JIRA Project(s)", "ABC\\d")

Receiving a Regex error

  1. issueFunction in issueFieldMatch("project = 123", "JIRA Project(s)", "ABC\\")

 

Can anyone solve this wildcard JQL need with an out of the box Jira solution or one using scriptrunner?

2 answers

1 accepted

0 votes
Answer accepted
Inactive Stephen
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.
July 18, 2019

Hi @Cory Beck

Does the basic query not work - I tried this on a Select List (Single Choice) and it worked:

issueFunction in issueFieldMatch("Project = 123","Field","ABC")

^ This located all issues containing a partial query - in this instance, I searched for three letters and it located multiple different options which contained the three letters in that order anywhere in the word. 

Let me know if this isn't what you're looking for or doesn't work multi-select.

Ste

Cory Beck
Contributor
July 19, 2019

@Inactive Stephen  - Well well, you are correct, that did work. Seems I didn't need any of the extra characters I read about in Adaptavists documentation. 

Inactive Stephen
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.
July 19, 2019

Awesome :) - I find keeping it simple is the best option unless you have a specific need (eg. ticket references with three letters and four numbers) - then regex expressions do work great!

Ste

1 vote
Sylvain Leduc
Contributor
January 11, 2021

Hello,
Which JQL should I use to exclude "ABC" and return everything but this ?
I tried 
issuefunction in issuefieldmatch("project=A","my custom field","!= ABC"), there is no error but no results either.

 

Thanks

Suggest an answer

Log in or Sign up to answer