How to create a clone/copy of Jira feature with all tasks with Automation?

Ray Stark
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!
November 2, 2023

Hello, I am trying to create an automation rule where someone can use it to copy an existing feature into the same epic and it will also copy all the child tasks from the existing feature into the newly created feature.

 

I created the rule below based on another thread and it does work but it just creates copies of the feature and all the tasks, each separate from the epic and the tasks separate from the feature so I assume it is an issue with my Epic Link but any help would be appreciated.

 

jira1.PNGjira2.PNGjira3.PNG

4 answers

0 votes
Luka Hummel - codefortynine
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 7, 2023

Hi @Ray Stark and welcome to the community!

From what you’ve described, it seems like you are on the right track but facing challenges with maintaining the hierarchy between epics and their features, as well as the features and their child tasks.

To achieve the desired outcome, Deep Clone for Jira could be the solution you're looking for. Deep Clone allows you to clone issues and maintain their hierarchical relationships, like epics and child issues, easily and efficiently.

Here's how Deep Clone can help with your specific need:

  1. Cloning with Hierarchy: When you clone a feature that is part of an epic, Deep Clone can automatically link the cloned feature to the same epic. This preserves the structure you have in place without any additional configuration.

  2. Bulk Cloning: You can clone features and all their child tasks in one action. Deep Clone ensures that the newly cloned tasks are correctly linked to the newly cloned feature.

  3. Automation: While Deep Clone does not directly create automation rules, it simplifies the cloning process to such an extent that you can manually perform cloning actions in a fraction of the time it would take to set up complex automation rules.

By using Deep Clone for Jira, you can bypass the complexity of automation rules for this task and ensure that your issue hierarchy is replicated correctly with minimal effort.

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.
November 3, 2023

Hi @Ray Stark -- Welcome to the Atlassian Community!

In your rule image, the Feature issue create is trying to set the "Epic Link" to {{epickey}} and the branch is trying to create the child issues and link them to the just-created Feature, using the smart value {{feature.key}} Neither of those smart values exist.

Before we proceed, would you please confirm your issue hierarchy?  That will impact which smart values to use.  For now I will assume you are using this:

  • Epic
    • Feature
      • Story, Task, or Bug

And so you have renamed the built-in Epic as Feature, and inserted "Epic" above that.

Thus when you create a Feature, I believe it is the parent field you want to set, copying that from the trigger issue.

After that Feature is created, the new key should be saved to use in adding the child issues.  You may do that with the Create Variable action:

  • name: varFeatureKey
  • smart value: {{createdIssue.key}}

Finally, when creating (cloning) the child issues, the "Epic Link" field may be set to {{varFeatureKey}}

Please try those changes and share what you observe.  Thanks!

Kind regards,
Bill

Ray Stark
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!
November 7, 2023

Hello Bill, I have attempted what you said but got the below issue. I wonder if it is because I am aiming to copy a Feature and make a new feature but I do not want it within the same project or epic, I want it as a standalone feature with all the child tasks within it that I can then link manually to the epic of my choosing. 

Also to confirm, yes that is the heirarchy

jira4.PNGjira5.PNG

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.
November 7, 2023

Some adjustments to improve your rule are:

  • Move the create variable action to after the issue create and before the branch.
  • Inside of the branch when you create the new child issue, you want the parent to be the new feature, not the trigger issue.  Please type in the smart value from the created variable: {{varFeatureKey}}

One more thing...

You describe creating the new feature in a different project, but your rule is creating it in the same one.  Is that what you wanted?

Ewelina Kluska
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!
August 26, 2024

Hi @Bill Sheboy 

I need to create new feature in the same project and implemented your suggestions. This is my first contact with automation so could do it wrongly. Can you review and add comments? Maybe show an example?


1. Automation_rule_general.PNG


2. Automation_create_issue.PNG


3. Automation_create_issue_2.PNG


4. Automation_create_variable.PNG

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 9, 2024

Hi @Ewelina Kluska -- Welcome to the Atlassian Community!

Sorry for the delay in responding as I have been offline for a few weeks.

And, as this is an older thread, I recommend creating a new question and perhaps adding a link back to this one.  That will ensure the maximum number of people see it to offer suggestions.

Back to your questions...

Why is your rule branching to All Created Issues?  Are you trying to copy data from the just created issue?

What is the purpose of the variable for your scenario?

And...if the intent of that variable is to save the key of the first created issue, please try:

  • first, move the variable create to immediately after the issue is created
  • next, note the variable create is looking for a smart value, and so it could be this:
    • action: create variable
      • name: varFeatureKey
      • smart value: {{createdIssue.key}}

Kind regards,
Bill

0 votes
Thibaut Subra _Elements_
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.
November 3, 2023

Hi @Ray Stark 

Welcome to community!

If you're willing to use a third-party application, I can suggest trying our Elements Copy & Sync app that allows you to copy issues with all their content (summary, description, custom fields, comments, attachments, etc.) and their child issues.

Using our feature Copy full hierarchy, you can copy an issue with all its hierarchy tree, including subtasks.

You can trigger the cloning directly from the issue but you can also trigger the cloning using Automation.

Don't hesitate to try our app, it's free during 30 days and stays free under 10 users.

Let me know if you have any question.

Regards

Thibaut

0 votes
haneryyy
Contributor
November 2, 2023

It's great that Ray Stark is making efforts to set up the automation rule in Jira. Your appreciation for his work and effort is indeed a positive gesture. Thank you for recognizing and appreciating his contributions to the project!

Suggest an answer

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

Atlassian Community Events