Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to set value in a multi select?



I am using the code below to set value in multi select field. The value is not being set. 

Please advice.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.config.FieldConfig
import com.atlassian.jira.ComponentManager

// Set to Team
CustomFieldManager sa_team_field = ComponentAccessor.getCustomFieldManager()
CustomField sa_team = sa_team_field.getCustomFieldObject('customfield_16334') //to Team
def config = sa_team.getRelevantConfig(issue)
def value = ComponentAccessor.optionsManager.getOptions(config)?.find { it.toString() == 'CUSTOMER MGT IND' }
issue.setCustomFieldValue(sa_team, value)




1 comment

A multi-select field holds an array of options, not a single value.

If you wrap your selected option(s) in a list of some sort, you should find it posts ok.


Log in or Sign up to comment
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

679 views 17 19
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you