The following sets a single component, but need to add up to 5 different Components on several of the issues cloned during a script post function. I searched online and could not find any examples on how to accomplish.
def projectComponentManager10 = ComponentAccessor.getProjectComponentManager()
def newcomponent10= projectComponentManager10.findByComponentName(project10.getId(), "FSU")
issue.setComponent([newcomponent10])
Environment - Adaptavist ScriptRunner v5.3.5 with JIRA v 7.4.4
Thanks,