How to copy components from source issue to destination when cloning via Automation rule
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
When cloning tickets using automation rule components don't get copied over as components are a project-level concept. Components are defined under each project separately, so copying them is not possible by using the standard "Copy from Trigger issue" option in the Clone issue component in the Automation rule. In this article, you will see how to use the "More Options" > "Additional fields" section to copy over components.
Solution
Set any trigger(issue-related presumably) for the automation rule.
Add any condition components if needed
Add the "Clone Issue" component and in that go to "More Options" > "Additional fields" section.
Copy and paste the below Json in the "Additional fields" box
1 2 3 4 5
{ "fields": { "components":{{triggerIssue.components.name.asJsonObject("name").asJsonArray}} } }
Don't tick the "Components" field checkbox in the "Choose fields to set" option. You can choose other fields to set if needed but not Components
Save and Update the rule.
This will set the components in the destination/cloned issue directly and even create the component in the destination project if it doesn't already exist.
Was this helpful?