Forums

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

JIRA Automation Rule for copying one specific component from an epic to a story or task

Cayce McCraw
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 15, 2025

Our project uses multiple components on epics, features, stories, and tasks. I am trying to create a JIRA automation rule to copy one specific component to a child issue when created or epic link is edited. 

I am able to create the rule to copy all components from the epic based on the epic link - values changed trigger, but the use case I have is to copy one specific component out of many. 

Looking forward to the assistance!

3 answers

2 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.
April 15, 2025

Hi @Cayce McCraw -- Welcome to the Atlassian Community!

When adding (or removing) a specific Component value, please use the advanced edit features with a JSON expression: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Components

In that documentation, also see the examples for the Labels field to see how to add a value using the "update" attribute.

 

If this does not help, please post the following for context:

  • your version of Jira: Cloud, Server, or Data Center
  • for Cloud, your project type: company-managed, team-managed, JPD, etc.
  • an image of your complete rule, in one continuous image
  • an image of the Edit Issue action
  • an image of the audit log details showing the rule execution
  • explain what is not working as expected and why you believe that to be the case

 

Kind regards,
Bill

Cayce McCraw
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 15, 2025

Thank you for helping me! I've entered the JSON based on documentation above, however, I am receiving errors saying JSON is not valid. 

Automation Rule.JPGAutomation Error.JPG

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.
April 15, 2025

First, you are using Jira Server / Data Center, and so the JSON documentation for that version may be found here: https://confluence.atlassian.com/automation/advanced-field-editing-using-json-993924663.html

 

Next, please read the JSON documentation carefully, and note I also described looking at the Labels field for an example to use the "update" attribute.

As an example for the Components field, that would be this for the values you show:

{
"update": {
"components": [
{ "add": { "name": "FPS O&M" } },
{ "add": { "name": "FPS Program" } }
]
}
}

 

Also note well: in the Edit Issue action, you have selected the Components field from the dropdown list AND used JSON.  Only one of those can be used at a time for the same rule action for a single field.  De-select the field from the dropdown list.

Cayce McCraw
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 15, 2025

Thank you for the quick response - I was able to successfully use the above to add both components, however, my initial question may not have been clear. I need to "copy down" or "add" either "FPS O&M" or "FPS Program" components depending on which component the Epic has - the epic would have one or the other, but not both. The epic could also have additional components such as multiple team names/components, so a straight copy of all components down to the story or task level wouldn't work either as stories and tasks would be worked by different teams. 

I really do appreciate your time, and hopefully this clarification will help get us closer to resolving my dilemma!

0 votes
Davide Schillaci April 16, 2025

Hi @Cayce McCraw ,

Welcome to Atlassian community!
You could try something like this:

Screenshot 2025-04-16 093109.png

Let me know if it works for your scenario.
Bests!

0 votes
Kim Euker
Community Champion
April 15, 2025

In this case you want to look at the Advanced Editing features.  You need to append your value to the existing components in the child.  Then, using the advanced editing you can update the components to have the existing components and the new components

{
"fields": {
"components" : [ {{AllComponents}} ]
}
}

 

Suggest an answer

Log in or Sign up to answer