Trying to case search a list (from a checkbox field) to produce text string

Hey all,


I previously asked this question:

But I'm still having trouble with the formatting to make this work.  Basically, I have a checkbox field that can contain multiple values, and I need to check it for specific values, then output a specific result should it contain the right values.

I believe checkbox fields make Lists, so I've set this up to search the test field 'Example'"

def List x = getCustomFieldValue("Example")
switch (x) {
 case ["Test", 'inList']:
     return "A"
        return "C"      


I'm stuck in the 'case' part of the search.  No matter how long the list is, I need a case function that will search through the list for "Test", and if it finds a match, will output "A".  Just can't seem to make it work.


1 answer

Hi Cody,

The following example works for me.

def multiSelectFieldValues = getCustomFieldValue("multiSelectExample")*.value
log.debug("Values of multi select : ${multiSelectFieldValues}")
if (multiSelectFieldValues?.contains("Option2"))
return 'Option2 is selected'

return 'Option2 is not selected'

Hope this will help you 


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

886 views 3 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you