Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Update story fields on creation based on Parent Fields

Michael Melton August 22, 2024

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

 

My edit fields is currently configured like below:


image.png

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

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
August 22, 2024

Hello @Michael Melton 

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.

Michael Melton August 23, 2024

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)


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

Thank you so much for the help!

Trudy Claspill
Community Champion
August 23, 2024

Thank you for the additional information @Michael Melton 

I'm curious to see your answer to @Bill Sheboy '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

 

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

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

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

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.

Michael Melton August 25, 2024

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!

Trudy Claspill
Community Champion
August 25, 2024

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/

 

Michael Melton August 25, 2024

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

Like Trudy Claspill likes this
0 votes
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.
August 23, 2024

Hi @Michael Melton -- 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

Michael Melton August 25, 2024

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? :)

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.
September 8, 2024

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.

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