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)
}
}
Hey @Aisha M
Switch to Automation instead of ScriptRunner in this case.
You can simply do the following:
Trigger = "Value changed" on edit (Fix Version)
Branch rule: on all children
Edit work-item: Fix-Version Copy from current work-item.
@arielei Thank you for the reply
I can understand that automation could be an easier option. But I really want to understand how the scripts differs between the two, because we have a huge amount of scripts that needs to be adapted to suit the cloud environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.