Automation to Copy cascade field values from Parent to Sub-task doesn't override the default value
Asked by Natalia Trofimov:

The following advanced JSON block is not working if the subtask has the default values set on creation. It shows success but it doesn't work, the values are not copying and keeping the default values. The automation using this JSON works though if you update the parent, then the values are copying to sub-tasks.

the select cascade field is common for other projects so I don't want to change the default value for subtasks

```
{  "update": {    "Sample Cascade": [      {        "set": {          "value": "{{triggerIssue.fields.Sample Cascade.value}}",          "child": {            "value": "{{triggerIssue.fields.Sample Cascade.child.value}}"          }        }      }    ]  }}
```


Answers:
author: Bill Sheboy
body: Hi [@Natalia Trofimov](/t5/user/viewprofilepage/user-id/4038792)

Would you please show images of your complete rule and audit log details for context? That may help the community to offer ideas. Thanks!

Until then, if you are using the issue created trigger I wonder if this is a timing issue with the event firing before the data is available. The way to check that is to add a Re-fetch action after the trigger to slow the rule a bit.

Kind regards,  
Bill

comments: author: Natalia Trofimov
body: Hi Bill, here it is:

![Screen Shot 2022-01-11 at 7.16.08 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/177228i77EECB940D810CDE/image-size/large?v=v2&px=999 "Screen Shot 2022-01-11 at 7.16.08 AM.png")![Screen Shot 2022-01-11 at 7.18.15 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/177229iE5191DFF8EB09B91/image-size/large?v=v2&px=999 "Screen Shot 2022-01-11 at 7.18.15 AM.png")


author: Bill Sheboy
body: Hi, Natalia, and thanks for that information.

Would you please clarify what you are trying to update? Your rule shows updating the trigger issue with the same values from itself. (There is no branching to other issues.)

Which are you trying to accomplish?

1. Update the parent from the subtask
2. Update the subtask from the parent
3. Something else?


author: Natalia Trofimov
body: Hi Bill, I knew i am missing something.

2. Update the subtask from parent


author: Bill Sheboy
body: Thanks, and in that case you can probably simplify your rule:

* trigger: issue created
* issue fields condition: issue type is sub-task
  * Note this is the simplest condition component and I think you were trying to use the if/else
* action: edit issue field, for your custom field, and select to Copy From Parent from the ... at the right side of the field in the rule component


author: Natalia Trofimov
body: Hi Bill, yes it is easy if i had an option to copy the cascade field from parent but the cascade fields can be set only with JASON block. I am missing something: another if statement or diff JASON...


author: Bill Sheboy
body: Sorry, I don't use that field type often and forgot that. There is a suggestion to add built-in support for those field operations: <https://jira.atlassian.com/browse/JRACLOUD-74280>

Until that is available...

The work-around if you are using Jira Cloud is to branch and capture the parent values for the field in created variables. And then use those directly in the JSON edit on the sub-task.

If you have Server/Data Center, it does not have created variables. In that case I would suggest inverting the problem: add an indicator to the parent issue, telling it to update the specific sub-task. (Perhaps with a comment for the sub-task key.)