Querying for a partial match in a multi-select custom field in JIRA

Ben Marsh April 4, 2017

I have a multi-select custom field (Let's call it MSCField) in all issues in my JIRA project and I want to be able to create a JQL query that returns all issues where the selected value in that custom field contains a particular string.

For example, if the possible selectable values in MSCField are:

A111, A222, A333, B111, B222, B333

...I want to create a query that returns all issues where the selected value in the MSCField contain the letter A. So it will return all issues where the selected value is A111 or A222 or A333. But it will not return issues where the selected value is B111, B222 or B333.

I have tried using things like:

"MSCField" IN "A"

"MSCField" ~ "A"

"MSCField" = "A*"

and none of them work.

Can anyone help me out here?

In case relevant, I've been told that a more specific name for the type of custom field I have here is "Select List (single choice".

1 answer

0 votes
Ron Gates April 4, 2017

As far as I know bare Jira does't allow that.

But you can try ScriptRunner plugin which expands Jira search functionality and alows seraches based on Regular Expressions:

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_regular_expressions

Ron Gates April 4, 2017

Apparently this method is only working on some Jira fields like Summary or Description but is not working on most custom fields.


@Ben Marsh - is using Groovy (in ScriptRunner's Script Console) or using Python (to search via JIRA REST API) and option for you? I think with those methods (search + data processing) you would be able to generate list of matching issues (I suspect Groovy working on Jira backend will search faster).

Suggest an answer

Log in or Sign up to answer