Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Copy cascade field from epic to issue by automation

I am trying to update a cascade custom field in an issue by copying data from the issues epic. The field is context formatted with a default setting for the value. I get successful executions on the rule, but what happens is that instead of copying data from the epic, the context data is removed and the field is blank. 

Any suggestions?

Automation setup below (the field is named Process):

WHEN: Issue Created

IF: Related Issue: Epic
     Condition: Exists

THEN:

{
  "update": {
     "Process": [
         {"set": {"value": "{{issue.parent.fields.Process.value}}",
           "child": {"value": "{{issue.parent.fields.Process.child.value}}"}
         }}
      ]
   }
}

2 answers

This JSON worked for me:

{
"update": {
"CascadeFieldName": [
{
"set": {
"value": "{{issue.epic.fields.CascadeFieldName.value}}",
"child": {
"value": "{{issue.epic.fields.CascadeFieldName.child.value}}"
}
}
}
]
}
}

Reference (Smarter Smart-Values!): https://blog.codebarrel.io/synchronize-parent-and-sub-task-issues-with-automation-for-jira-bdcca6c9d453

0 votes
John Funk Community Leader Feb 26, 2021

Hi Krister - If you want to retain the current value and just append the new value in, then place {{issue.Process}} before the new value. That way it will keep the current value and add the new value. Of course, you can switch the order around if you want the new value first. 

The value stated in the epic should replace any value in the child issue. The current value should not remain, i mentioned it having a value through the context partly if it can have an effect since this takes place at the time of creation and the thought was that there may be an issue where they collide or something. The other part of mentioning it is that it shows that something does happen it does not however copy the values as intended.  

John Funk Community Leader Feb 26, 2021

Have you tried to update the field just using the standard field update and not JSON?

Cascading fields are not supported by the standard field update as far as i have been able to find. 

John Funk Community Leader Feb 26, 2021

Ah, that makes sense then. 

What type of project is this? 

I assume that you are firing this on the child getting created and you want to copy down the value from the Epic. Correct?

Entirely correct, this is a scrum project and the field is one of many metrics that are filled out which we want to be inherited as default to reduce time and errors in the issue creation process.  In 90%+ of the cases the issue should have the same as the epic so making it default to that would reduce the amount of errors. Simply setting it as a mandatory field gets us the data but it has a much higher error ratio. 

I also know that its possible create this solution with the workflow but there is two issues with that.

The first being that this is a standardized system with multiple projects using the same workflow so its not always the case that we want this rule to fire. To the greatest extent possible using automation is therefore the go to solution for adapting projects. 

The second issue is that this is just the first part of the rules that we intend to create there will be if statements and different cases where it will do other things, I just thought to keep the question simpler by not having that extra complexity.   

John Funk Community Leader Feb 26, 2021

Since you are populating 90% plus with the Epic data, why not add automation to Clone the Epic to another Issue Type, and then Edit the Clone? 

Just as a side note, there is no Scrum type of project, just Scrum boards. Project types are either Classic Software or Next-gen in this case. 

With Classic Software, I would try the Epic Link instead of the Parent. But for Next-gen you need the Parent wording instead. 

One final option would be to try the code without the word fields. I am not sure about the JSON for that, but using Automation you would not use that. So it would be:

{{issue.parent.Process.value}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Posted in Trello

Taco Tuesday: Your favorite Trello blog takeaway

Hello friends! From the community that brought you Welcome Wednesday, Throwback Thursday and Friday Fun, welcome to Taco Tuesday, a weekly discussion about all things Trello. The best part? One Tac...

80 views 6 5
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you