Hi, I've just migrated from scriptrunner server to scriptrunner cloud and am trying to re-write my script to add multiple components to an issue.
I've tried this:
issueInput.fields.components = [[name: 'Operations1']]
which works and just sets a single component.
But when I try this:
issueInput.fields.components += [[name: 'Operations1']]
issueInput.fields.components += [[name: 'Operations2']]
I get the following error:
2019-04-16 10:25:42.463 ERROR - Cannot execute null+[{name=Operations1}] on line 1
2019-04-16 10:25:42.503 ERROR - Class: com.adaptavist.sr.cloud.workflow.UpdateIssue, Config: [className:com.adaptavist.sr.cloud.workflow.UpdateIssue, uuid:3f47bc8a-64d6-4100-840b-77be047f1861, description:Add Operations1 and Operations2 as Components, enabled:true, executionUser:ADD_ON, additionalCode:issueInput.fields.components += [[name: 'Operations1']]
issueInput.fields.components += [[name: 'Operations2']], userKey:e01807, accountId:5cb5998a9a857910896fd759] Any ideas how I can get this to work please? I need the script to add the new components and leaving alone any existing components already attached to the issue. i.e. I do not want to overwrite what is there already - I need the new ones to be added.