Hi guys,
Jira software - Server - Script Runner
By means of a post function of script runner, I am trying to establish or select the value of a custom field of type "Project picker", but I have not been successful.
def cfSelect = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("associated project")
def cfConfig = cfSelect.getRelevantConfig(issue)
def value = ComponentAccessor.optionsManager.getOptions(cfConfig)?.find {
it.toString() == 'Project XXX'
}
issue.setCustomFieldValue(cfSelect, value)
This code works perfectly with custom fields of type list, but not with custom fields of type "Project picker".
Hi,
The solution is to set value like for a standard custom field (not select). But the value object should be of type com.atlassian.jira.project.Project
For example:
issue.setCustomFieldValue(getCustomField(PROJECT_DELIVERY), sourceIssue.getProjectObject());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.