Hello all together,
I'm in Jira Datacenter 9.4.8 running Automation for Jira version 9.1.1 and ScriptRunner version 8.29.0.
Within a manually triggered automation rule I need a groovy script to add the components of some linked issues to the trigger issue.
I've tried many ways, but there seems to be no way to do the add.
I've found some ways where I didn't get any error, but the components were not added.
This is one of my variants for you to understand what I'm trying to do:
import com.atlassian.jira.component.ComponentAccessor
def linkedIssues = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())?.findAll
{it.issueLinkType.inward == "Ticket enthalten in Softwarefreigabe / Issue included in Software Approval"}
def linkedIssue = null;
def comp = null;
for (int i = 0; i < linkedIssues.size(); i++) {
linkedIssue = linkedIssues[i].destinationObject
comp = linkedIssue.getComponents()
issue.components.addAll(comp)
}
Unfortunately your script doesn't bring any error (like mine) but does not have any effect on the issue (like mine).