Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Update fix version of subtask when parent is updated

Aisha M
Contributor
June 3, 2025

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)

         

    }

}

1 answer

0 votes
arielei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 3, 2025

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.

 

Screenshot 2025-06-03 at 13.40.11.png

Aisha M
Contributor
June 3, 2025

@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. 

Suggest an answer

Log in or Sign up to answer