I have just started using Scriptrunner on Cloud. I have been using the DC version, and would like to see how the scripting differs between the two.
We have a script that updates the fix version of sub-task when parent fix version is updated. I am trying to recreate this in Cloud , but nothing seems to work.
Can I please get some help on how this could be achieved.
Below is the DC script:
IssueManager issueManager = ComponentAccessor.getComponent(IssueManager.class)
Issue updatedIssue = event.getIssue()
Collection<Version> fixVersions = new ArrayList<Version>()
fixVersions = updatedIssue.getFixVersions()
Collection<Issue> subTasks = updatedIssue.getSubTaskObjects()
subTasks.each {
if (it instanceof MutableIssue) {
((MutableIssue) it).setFixVersions(fixVersions)
issueManager.updateIssue(event.getUser(), it, EventDispatchOption.ISSUE_UPDATED, false)
}
}