Hi,
I am setting up a behaviour in Scriptrunner and for the most part have everything working what isn't working is the setting of my single select values.
What's happening is that when I set the option values the option of 'None' is not available.
I've striped down my code to remove any conditions and only set the options to see if they were the cause of the problem. It has not made any difference to the outcome.
Bellow is the code I'm currently running. As you can see in the log output that None is missing and is also missing from the drop down.
Did I miss something? Or is this expected?
Any help would be appreciated.
Neil
//Participation Type Field Options
def ParticipationTypeCF = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_14911");
def ParticipationTypeConfig = ParticipationTypeCF.getRelevantConfig(getIssueContext());
def ParticipationTypeOptions = optionsManager.getOptions(ParticipationTypeConfig);
// Set the values inside the select list field
def ParticipationTypeMap = ParticipationTypeOptions.findAll {
it.value in ["None", "Informal Remarks", "Keynote Address", "Speech", "Report"]
}.collectEntries {
[(it.optionId.toString()): it.value]
}
ParticipationTypeField.setFieldOptions(ParticipationTypeMap);
log.warn("***** ParticipationTypeOptions **** " + ParticipationTypeOptions);
--- Log output ---
018-11-07 10:24:23,197 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json [jira.groovy.user.FieldBehaviours] ***** ParticipationTypeOptions **** [Informal Remarks, Keynote Address, Speech, Report]