Forums

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

Listner script to update parent task field when subtask field is updated

Tanu
Contributor
January 16, 2020

I want to write a Listner Script to update parent task custom field when subtask is custom field is updated.

Please help

1 answer

0 votes
Nic Brough -Adaptavist-
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.
January 16, 2020

https://library.adaptavist.com/entity/update-the-value-of-a-custom-field-using-a-listener does most of what you need.

You'll need to remove the "is this a subtask" check, and reverse the intent so that it updates the parent

Tanu
Contributor
January 17, 2020

I am getting a lot of errors, please help me .
Your help is too much required.

image.png

Tanu
Contributor
January 17, 2020

@Nic Brough -Adaptavist- 

 Looking forward for your help here. :)

Nic Brough -Adaptavist-
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.
January 22, 2020

If you hover the mouse cursor over the red X's it will give you helpful error messages.

To get you started, I think line 18 will give you something like "no such property".  This is because the call you want is a method, not a property, and you've got the name wrong!  Check the case of the letters in the call, and add () to the end of it to force it to look for the method.

Line 24 is probably not going to work either, as "subtask" will now hold a list of sub-tasks, not a single one.  You'll need to iterate over that list.

Suggest an answer

Log in or Sign up to answer