How to set multiselect options for an Issue using Java (SDK). Can someone share a sample code please.
Community moderators have prevented the ability to post new answers.
I am trying to update Custom Filed Value on an Issue through a custom Plugin.
Custom Field is of type multi select dropdown
I have a groovy script whcih does this easily as below. However I need to move this inside a custom plugin. Not sure what should be the corresponding code for it in Java.
def optionsManager = componentManager.getComponentInstanceOfType(OptionsManager.class)
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'CUSTOM FIELD NAME'}
if(cf!=null)
{
def fieldConfig = cf.getRelevantConfig(issue)
def option = optionsManager.getOptions(fieldConfig).find {it.value == businessUnit.toString()}
def currentOptionsBusinessUnit = issue.getCustomFieldValue(cf) ?: []
issue.setCustomFieldValue(cf, currentOptionsBusinessUnit + [option])
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.