I've created a post-function that creates sub-tasks based on checked checkbox values in a transition screen. As part of the sub-task creation, I want to copy all relevant parent fields into each sub-task. It's working fine for simple values, but I've been unable to copy selected values from select/multiselect/radio elements from the parent into the subtask.
Not only have I been unable to figure this out thus far, I can't find a wholly relevant example to refer to.
This works for a simple field:
...
emailAddressField = customFieldManager.getCustomFieldObjectByName("Email Address")
emailAddressValue = emailAddressField.getValue(issue)
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters().with {
...
addCustomFieldValue(emailAddressField.id, emailAddressValue)
...
}
But this doesn't work for a select element:
...
inquiryTypeField = customFieldManager.getCustomFieldObjectByName("Inquiry Type")
inquiryTypeValue = inquiryTypeField.getValue(issue)
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters().with {
...
addCustomFieldValue(inquiryTypeField.id, inquiryTypeValue );
...
}
The error on the latter is groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.addCustomFieldValue() is applicable for argument types: (String, ArrayList) values: [customfield_10207, [My Value]]
Any feedback or assistance would be appreciated.
Thanks!