Update story fields on creation based on Parent Fields
Asked by Michael Melton:

I have created an automation workflow in our ticketing system (Fresh Service) that creates Features in Jira and prepopulates some fields on that feature.   

I would like to create automation in Jira that runs every time a story is created under that feature to apply those same values from the Parent Feature to the child story.   

I have started this and am able to validate I can get the values from the parent by sending an email as an action. I am struggling with getting the child stories to update and am hoping for some guidance. I am not sure if I am going around the branching appropriately, or if my JSON object is correct for updating the custom fields we have created in our Jira instance.  

Below is an image of the workflow:  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/343354i76B6EEA600B6DC2B/image-size/large?v=v2&px=999 "image.png")

My edit fields is currently configured like below:

<br />

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/343356i2451B9E4E1503CB8/image-size/large?v=v2&px=999 "image.png")  

Any help is greatly appreciated as I learn how Jira automation works. Thanks!


Answers:
author: Trudy Claspill
body: Hello [@Michael Melton](/t5/user/viewprofilepage/user-id/4271746)

Welcome to the Atlassian community.

What information is in the rule execution Audit Log from when the rule executes?

What are the field types of the fields you are trying to update? Are the source fields in the parent issues the same types as the corresponding destination fields in the child?

You actually don't need to use branches at all. I'll provide an example when you provide answers to my questions.

comments: author: Michael Melton
body: Two of the fields are single select fields, one of them is a single line text field. The parent Feature gets created with these fields. My hope is when teams create child stories to always inherit / apply the same values.

The error from the string field is: Operation value must be a string (customfield_10001)

The error from the select fields are like: Specify a valid value for Work Type (customfield_10002)

<br />

I imagine this is because it is pulling from the Stories but not the Feature.   

Thank you so much for the help!


author: Trudy Claspill
body: Thank you for the additional information [@Michael Melton](/t5/user/viewprofilepage/user-id/4271746)

I'm curious to see your answer to [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) 's question also.

Regardless, as I said, you don't need to use a branch for this. This is all you need in your rule:

![Screenshot 2024-08-23 at 10.41.05?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343549i11F287E9FD2C6C69/image-dimensions/249x268?v=v2 "Screenshot 2024-08-23 at 10.41.05?AM.png")

In the Edit action choose the fields in the child issue that you want to update.

For each one click the ... next to the entry field and select COPY.

![Screenshot 2024-08-23 at 10.42.28?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343552i4BF30524250DBAF9/image-dimensions/312x290?v=v2 "Screenshot 2024-08-23 at 10.42.28?AM.png")

That will fill the field with text similar to this, identifying the issue from which you want to copy the data, and the field in that issue from which you want to copy the data:

![Screenshot 2024-08-23 at 10.43.45?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343553i71DCBFB39EECC7FE/image-dimensions/288x160?v=v2 "Screenshot 2024-08-23 at 10.43.45?AM.png")

Click directly on that text and you will get a pop-up that lets you change the source issue and the source field from which to copy the data. Change the source issue to Parent Issue.

![Screenshot 2024-08-23 at 10.51.14?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/343556i7155614A23FBA5DE/image-dimensions/274x226?v=v2 "Screenshot 2024-08-23 at 10.51.14?AM.png")

As long as the field being used in the Parent and Child issue is the same field, there's nothing else special you need to do.

If you are copying from one field to an entirely different field, then there may be extra steps required.


author: Michael Melton
body: I will try this, my only concern was I was trying to avoid this running on every story if it didnt meet the criteria. I will give this a shot and see how it works/looks.  

Thank you!


author: Trudy Claspill
body: What is your concern specifically?

If the created Story doesn't meet the criteria, the way this rule is structured it will not be counted against your monthly rule execution limit. Refer to this for more information about how usage is calculated.

<https://support.atlassian.com/cloud-automation/docs/how-is-my-usage-calculated/>


author: Michael Melton
body: I was just over complicating how to get it to work is all. Thank you for your help, your suggested method worked out great!


author: Bill Sheboy
body: Hi [@Michael Melton](/t5/user/viewprofilepage/user-id/4271746) -- Welcome to the Atlassian Community!

I am curious about something your rule image appears to show...

It shows one branch inside of another, or **nested branching** . I do not believe that is a feature of Atlassian Automation rules yet. Here is one of the suggestions to add that feature: <https://jira.atlassian.com/browse/AUTO-67>

Does your rule in fact have nested branches, and if so, how did you create that condition?

Kind regards,  
Bill

comments: author: Michael Melton
body: It does have nested branching, I created it under the initial condition then just dragged and placed it. It didn't yell at me so figured it was okay. Guess I found a bug? :)


author: Bill Sheboy
body: Thanks, Michael. From my observations...

That symptom / defect allowing drag-and-drop for branches (and some condition types) appeared intermittently for a couple of years with Jira Cloud automation rules. As it apparently was not designed to do that, the resulting behavior seemed a bit random.

I did note when such a rule was later edited it would not save / publish due to errors.


Tags: cloud

jira-cloud