Auto update a subtask when the parent is updated WITHOUT post function?

I know I can set fields for subtasks based on the parent during creation. However, when I change the fixVersion for the parent, I want all of the subtasks to be updated also.

I have JJUPIN, ScriptRunner, etc installed and I want to use a listener to achieve this so that it doesn't require a postfunction.

Every script sample I have seen only updates the field when the subtask itself is changed (not the parent) - example:

https://answers.atlassian.com/questions/155302/how-do-i-default-the-value-of-a-sub-task-field-to-the-value-of-a-parent-field

I have tried to modify the code, but I am not a developer :(

I have also tried to use a SIL listener but get the same result - the subtask fixVersion is not updated when the parent issue is changed.

The SIL listener:

if(isNull(parent)) {
   fixVersion=customfield_11901;
} else {
   fixVersion = parent.fixVersion;
}

(The customfield_11901 is a string that contains the Sprint name because our fixVersion = Sprint and we don't want to have to set that field manually.)

Can anyone help please?

2 answers

1 accepted

Here is what we ended up with - using SIL:

fixVersion=customfield_11901;
if(isNotNull(parent)) {
   return;
}
for(string subtask in subtasks(key)) {
    %subtask%.fixVersions = fixVersions;
}

Where customfield_11901 is a string field with the sprint name.

2 votes

You need to do the listening the other way around. Listen for events on the PARENT issue, then check if it has subtasks, and if it does, iterate through them with updates.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

77 views 0 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you