How do I copy component/s from Phase(Parent) to the Epic(Child)

Velizar_Velizarov January 15, 2025

Hi,

I need to copy component/s from Phase(Parent) to the Epic(Child) in Automation when the Epic is created.

 

Thank you.
Velizar
PS
It is not the same as copying the component from a Parent/Epic to Child tickets/Issues in Epic

2 answers

0 votes
Tessa Tuteleers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2025

Hi @Velizar_Velizarov , 

Welcome to the community! 

Are you on Cloud or DC (you tagged both and automation works a little different on both platforms) 

Cheers, 

Tessa

Velizar_Velizarov January 15, 2025

DC

Cheers

0 votes
Dick
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.
January 15, 2025

Hi @Velizar_Velizarov Welcome to the Atlassian Community

You would need to use the JSON part of the automation to update the component/s field (which holds an array of strings). You can find documentation on this: 

automation/docs/advanced-field-editing-using-json/ 

Kind regards,

Dick

 

addendum The above is for both cloud and datacenter solutions

Velizar_Velizarov January 15, 2025

Could you give me an example that is connected to my question?

BR
Velizar

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

{
"update": {
"components": [{
"add": {"name": {{Domain.asJsonString}}}
}]
}
}

 

In this example, Domain was defined as a variable using Create Variable in Automation.
This should also work with "somethinglikethis" 

Like Velizar_Velizarov likes this
Dick
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.
January 15, 2025

The quoted documentation holds one really big piece of code with the Supported fields & Operators. There you can read on lines 39 to 52 that there are in fact three operators available for the components field: add, set and remove.

Hope to have given you a fishing rod instead of a fish

:)

Dick

Like Velizar_Velizarov likes this
Dick
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.
January 15, 2025

Hi @Velizar_Velizarov 
Could you mark this as an answer, so that others with a similar problem can find it easier please?

Thanks a bunch,

Dick

Like Velizar_Velizarov likes this
Velizar_Velizarov January 15, 2025

Sure, I will do it, but first, I want to check it. I think this is only one part of my question. The real problem is that I can't get the Phase(Parent) Component/s and set it to Epic(Child) in automation. Or if I bring them to a different branch, I can't go back and add them to the Epic(Child) even with Variable.

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

First step would be to share your current automation with this community then. 

It should be triggered by on create (or with an extra automation on field change, depending on your helpfulness to your users). Followed by making sure it's an epic you're working on by the conditional issuetype = epic. Then the action would be to lookup the phase issue using the parent link of the epic. Then securing the components of the phase (use a logged variable to have some feedback on how the automation is working for you), followed by editing the components field of the triggerissue. 

the floor is yours...

Dick

 

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

If you need the complete array of components to be copied over, the JSON code would be like: 

{ "fields": { "components": {{issue.parent.components.asJsonStringArray}} } }

 

Where fields is a shortcut for calling update with the set operation. 

Suggest an answer

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

Atlassian Community Events