Automating Copy of Cascading Fields

Tim van Boeschoten June 13, 2023

Hi. 

We have an automation which copies down multiple fields to a Sub Task which is a functional option for our team and assists in reporting. 

One of my team recently implemented Cascading fields to identify Business Units and Teams underneath them however the general Automation options did not exist. 

Therefore, I read into using the below, but I cannot seem to get this to work. Any ideas.

I have tried changing the Custom Field to the Field Name and no dice. Any Ideas?

{
"update": {
"customfield_10095": [
{
"set": {
"value": "{{TriggerIssue.fields.customfield_10095.value}}",
"child": {
"value": "{{TriggerIssue.fields.customfield_10095.child.value}}"
}
}
}
]
}
}

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
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 13, 2023

Hi @Tim van Boeschoten 

Please try adjusting your syntax to this one:

{
"fields": {
"customfield_10095": {
"value": "{{triggerIssue.customfield_10095.value}}",
"child": {
"value": "{{triggerIssue.customfield_10095.child.value}}"
}
}
}
}

And also, note that smart values are name, spacing, and case-sensitive.  I adjusted the one for the trigger issue to match.

If that does not help, please post images of your complete rule and the audit log details showing the rule execution.  Those may provide some context for what is happening.  Thanks!

Kind regards,
Bill

Tim van Boeschoten June 13, 2023

Thanks Bill,
Interestingly. 99% of the time the result is Success. However nothing is copied. 

Bill Sheboy
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 13, 2023

Hmm...Would you please post images of your complete rule (including the edit action details) and audit log details?  Context is important for a symptom like this and so perhaps I am missing something obvious.  Thanks!

Tim van Boeschoten June 13, 2023

Here you go. 

AutomationSetting.pngResult.png

Interestingly every time it is "Success" But the field doesn't copy down. 

Tim van Boeschoten June 13, 2023

Got it working with Support help

 

{
"fields": {
"customfield_10095": {
"value": "{{issue.parent.customfield_10095.value}}",
"child": {
"value": "{{issue.parent.customfield_10095.child.value}}"
}
}
}
}

Bill Sheboy
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 14, 2023

Was the problem which issue was the source (current vs parent) or something else?

Tim van Boeschoten June 21, 2023

The biggest thing was changing triggerissue to issue.parent

Tricky as even the support docs don't really reference that. But oh well :)

Like Bill Sheboy likes this
Negar Mousavi May 12, 2024

hey there

i have the same question as you but i want to use it for the parent issue i have defined in my hierarchy levels
does this code only works on sub-task ?

i have provided the following code:
{
"update": {
"customfield_xxxx": [
{
"set": {
"value": "{{issue.parent.customfield_xxxx.value}}",
"child": {
"value": "{{issue.parent.customfield_xxxx.child.value}}"
}
}
}
]
}
}

Bill Sheboy
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.
May 12, 2024

Hi @Negar Mousavi 

As this is an older thread, I recommend creating a new question, and adding a link back to this one.  That will ensure the maximum number of people see your question; otherwise only people following the older thread will see it.

When you post your question, please include:

  • your Jira version and project type,
  • an image of the complete rule,
  • an image of the action with that JSON, and
  • an image of the audit log details showing the rule execution. 

Those will provide context for the community to offer suggestions.  Thanks!

 

Until we see those...

Jira Cloud transitioned to use the Parent field for all issue hierarchy relationships, and I believe Jira Server and Data Center still use separate fields, such as Epic Link and Parent.  And so your Jira version and rule specifics will impact how to meet the need.

Kind regards,
Bill

Like Negar Mousavi likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events