Copy two cascading fields during an automation

Laura Snoeij
Contributor
March 6, 2023

Hi, 

I have an automation in which an new issues will be created during a certain transition. 

During this action I would like to copy two different custom fields over to the new issue. These two custom fields are cascading fields. 

I managed to copy a single field over by  using 

{
"update": {
"customfield_xxxxx": [
{
"set": {
"value": "{{triggerIssue.fields.customfield_xxxxx.value}}",
"child": {
"value": "{{triggerIssue.fields.customfield_xxxxx.child.value}}"
}
}
}
]
},
"update": {
"customfield_xxxxx": [
{
"set": {
"value": "{{triggerIssue.fields.customfield_xxxxx.value}}",
"child": {
"value": "{{triggerIssue.fields.customfield_xxxxx.child.value}}"
}
}
}
]
}
}

How do I get a second field in? Just repeat the above does not work.  My knowledge on JSON is very limited. 

Thanks for your advice

Laura

1 answer

1 accepted

2 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 6, 2023

Hi @Laura Snoeij 

Try the following. I've tested it and works fine:

{
"fields":{
"customfield_xxxxx" : { "value": "{{triggerIssue.fields.customfield_xxxxx.value}}", "child": { "value" : "{{triggerIssue.fields.customfield_xxxxx.child.value}}"} },
"customfield_yyyyy" : { "value": "{{triggerIssue.fields.customfield_yyyyy.value}}", "child": { "value" : "{{triggerIssue.fields.customfield_yyyyy.child.value}}"} }
}
}
Laura Snoeij
Contributor
March 7, 2023

Alex, 

Thanks a lot. It works!

Laura

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events