clone an epic including its child issues

Sama Mohamed July 27, 2022

Is it possible to clone an Epic including its child issues in Jira Software without paying for deep cloning  

7 answers

1 accepted

7 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 28, 2022

Hi @Sama Mohamed - You could do this with automation:

  • TRIGGER: Manual
  • CONDITION: Issue Type = Epic
  • ACTION: Clone Issue
  • ACTION: Create Variable varNewEpic
    • {{createdIssue}}
  • BRANCH: Stories (or Other Issues in Epic)
    • ACTION Clone Issue
      • Epic Link
        • {{varNewEpic}}
Sama Mohamed July 28, 2022

Hello Mark, thank you for your answer. 

Can you kindly clarify this part :

  • ACTION Clone Issue
    • Epic Link
      • {{varNewEpic}}

where do I put the Epic link and varNewEpic?

Like # people like this
Sama Mohamed July 28, 2022
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 29, 2022

On your clone issue action, you'll want to copy/paste this into the Epic Link section:

{{varNewEpic}}
Sama Mohamed July 29, 2022

@Mark Segall I did what you have told me and the result was that all the issues inside the epic were cloned at the same time but they weren't cloned with their epic, they were cloned each separately as a different issue, do you know how I can put them all inside one Epic? 

For example :

This is my Epic with its child issues 

image.png

when manually triggered this is the result:

image.png

I want to put them inside a new epic automatically, and I want to clone the description of them as well

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 29, 2022

I've used this rule before and it should be placing them inside the epics.  Can you confirm whether this project is a company managed or team managed project?  If it is Team Managed, you'll need to change the field on your CLONE ISSUE action to use the Parent field instead.

Sama Mohamed July 29, 2022

Yes, its a Team Managed project 

Sama Mohamed July 29, 2022

@Mark Segall you meant this way right?

image.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 29, 2022

You need to change the Epic Link field to Parent.  Team Managed projects don't recognize the Epic Link field.  

Sama Mohamed August 2, 2022

@Mark Segall Hello, I would like to clarify something from you, Actually, I have tried the same rule in a company-managed software project and what happened is that the tasks were cloned, all of them inside the same Epic again

 

I want to extract them from the Epic and put them in a New Epic

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2022

Hi @Sama Mohamed - I'm looking at your screenshot.  You're just missing the first clone action which clones the epic itself.  Without this, the variable remains empty and the issues simply clone inside the same epic.

Sama Mohamed August 2, 2022

@Mark Segall can you kindly elaborate on this screenshot and tell me where exactly I should insert the cloning action? , sorry for the number of questions, and your help is really appreciated. 

image.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2022

Between your condition and create variable action.

Sama Mohamed August 2, 2022

@Mark Segall Thank you so much it worked :) :) 

Like Mark Segall likes this
Sama Mohamed August 7, 2022

@Mark Segall 

Actually, the rule worked perfectly, and thank you for that,

I want to ask you If you can guide me on how to add something to the rule which can clone the sub-child issues as well under the child issues, 

for example:

These are the child issues:

Child issues.png

These are the sub Child Issues:

Sub Child issues.png

Like # people like this
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 9, 2022

Getting into the sub-tasks is a little more tricky.  I've been thinking of the best way to handle it and I think this would be the best approach:

  1. On your rule, you could add an edit issue action after the clone action that adds a label to the template task.
  2. Create a second rule that will perform the sub-task copy and clear out the label upon completion:
    1. RULE DETAILS: Check the box "Allow Rule Trigger"
      2022-08-09_09-53-24.jpg
      2022-08-09_09-49-56.jpg

So what will happen here is that as each task is cloned, it applies a unique label on the template task which will trigger a second rule to clone all of its sub-tasks.  Once the sub-tasks are all cloned, it clears the label.

Sama Mohamed August 11, 2022

@Mark Segall I have a question 

Sama Mohamed August 11, 2022

@Mark Segall I did it this way but didn't work can you check here

image.png

subtasks.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 12, 2022

On your Cloning Epic rule, it appears that you're removing the label in your edit issue action.  This should be an ADD here because this is what will trigger the Cloning Sub-Tasks rule.  Then at the end of the Cloning Sub-Tasks rule, you should REMOVE that label.

sama mohamed August 14, 2022

@Mark Segall I have amended it as you have mentioned and changed to ADD label  in Cloning Epic and at the end of the Cloning Sub-Tasks rule I have REMOVED the label but still didn't work, I am not sure where is exactly the problem 

cloning epic.png\

for the Cloning Sub-Tasks :

1.

cloning sub tasks.png

2.

sub tasks.png

Do you think there are any problems in my implementation here? 

 

sama mohamed August 15, 2022

@Mark Segall the problem is that the cloning subtasks doesn't get triggered.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 15, 2022

For your Cloning Sub-Tasks rule, under Rule Details, make sure the checkbox is set for 

Allow rule trigger

Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule.

sama mohamed August 21, 2022

@Mark Segall, I actually got 2 actions that happened due to the cloning subtasks rule which are 

1. Loop happened that copies the epic itself 10 times but when it is copied 10 times it's totally empty

2. The original issue which I cloned from, created the same subtasks inside one more time and non of the child issues of the subtasks were cloned

I also already ticked in the rule details Allow rule trigger as you have previously mentioned

This is the loop

  image.png 

This is the original Issue 

Screenshot 2022-08-22 101240.png

Did I do anything wrong here in cloning subtasks :l 

4.png3.png2.png1.png

5.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 22, 2022

Hi @sama mohamed - The screen shots you shared look correct for the second rule.  If you're getting extra clones of your epics, that is likely an issue with your first rule - specifically, at what level you're adding the label.  Based upon the symptoms, you're adding the label to the epic instead of the individual tasks.  In your first rule, make sure the label is added as part of the clone action like this...

 

2022-08-22_06-41-07.jpg

Iván Muñoz August 25, 2022

Hi @Mark Segall ,

Do you know how to figure out this?

When cloning the subtasks they are linked to the original issue, and I couldn't find a way to assign those subtasks to the new cloned issue, I add detail in another comment.

 

Thanks

sama mohamed August 25, 2022

Hello, @Mark Segall Firstly thank you for this amount of help it's really appreciated, mmmm I would ask you to kindly watch my first rule and tell me what exactly are the mistakes since there is nothing wrong with the second rule as you have previously mentioned, since I have tried testing a lot the past days, and I am getting a lot of loops but didn't work as well :(, @Iván Muñoz this is my same issue, I will post the screenshots now and you can see what's wrong. after Mr.Mark can guide us.

Also,

Note: I have changed my unique label in the 2 rules to CTI as seen

1. This is the whole rule

image.png

2. First Cloning Action

image.png

3. Branch rule for stories and other issues in the Epic 

image.png

 4. This is the second Clone Issue Action

  Note :

I have added the label here because you have mentioned that I need to add the label to the level of issues level inside the epic 

image.png

5. Edit Issue Fields 

image.png

Like Jonathan Tasman likes this
3 votes
Endre September 14, 2022

I followed the same rule in this post  but it only clones the epic without the stories.

NOTE: Removed my images. Did not realize it would all expand and spam the space.

 

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 14, 2022

Hi @Endre and welcome to the community!

If I may ask, can you please create a new question in the community for this?  You can reference this question/answer and @mention me so I get pinged on it.  This thread was already a long one and I just want to make sure your question doesn't get lost.

Endre September 22, 2022

Thanks Mark. Finally I figured out the issue. I thought the manual trigger would trigger when I manually select Clone from the issue action menu. Still not sure what is manual trigger so used a different trigger that actually turned out as a value add. I share it here in case someone find it useful.

 

I replaced the manual trigger with  trigger value change on epic name. To start the cloning I change my template epic name to the epic name I want for my new project. Then as the last step of the cloning automation I reset my template epic name to original value. This way my cloned objects already named what I need them to be.

I still struggle cloning the checklist but I will post that as new question. 
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2022

Can you post the final rule here? 

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2022

@Endre - Manual triggers are executed from within an issue.  You should see something like this:

2022-09-22_13-28-27.jpg

Endre September 24, 2022

Thank you Mark.

Like John Funk likes this
Endre September 24, 2022

@John Funk  here is my automation and clone steps and result.

 Jira epic clone on template epic name change.pngcloning steps and result.png
Please LMK if you see any flaws or suggestions.


NOTE: Automation  steps I did not put comment on  are the same as in the original solution of this post.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2022

Thanks, @Endre !

1 vote
Shelly Walsh July 18, 2023

Hi All - This is by far the most straight forward instructional I have found on how to clone epics with tasks and subtasks.  

 

https://community.atlassian.com/t5/Jira-articles/Clone-Epic-Stories-and-Subtasks-tree-with-Jira-Automation/ba-p/2316387

1 vote
Florian Bauer
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.
February 16, 2023

Hey @Sama Mohamed 

If cloning an epic is not just a flash in the pan for you, but you want to repeat it multiple times, your epic is a process because recurring projects are processes!

Flower - Process Automation clones your Jira epics as repeatable processes, including all issues, links, and structures.

Here is how to clone an epic as a process.

 

Happy automating,

Florian

0 votes
Henri Oru November 25, 2022

Hello @Mark Segall

I also have a problem with automation, it clones the Epic but nothing else, can you help me with this? 

Even when I turn the subtask cloning off, it only clones the Epic.

chrome_1EkTqbJJuA.png

chrome_1bIApwlX4d.png

And also the sub-task cloning:

chrome_JB5Mnd4Ce5.png

chrome_gMFz4jpwso.png

Are there any mistakes or...? I can't figure this out on my own, have been at it for 2days straight now.

I'm using a Team-based project board...

 

Edit: idk why I got put in the middle, when clearly I was answering in the end.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 28, 2022

Hi @Henri Oru - Can we please move this to a new question (just @mention me in the new question)?  This one has gotten quite long and will be difficult to continue managing.  

0 votes
Iván Muñoz August 25, 2022

Hello,
I followed all the steps which were very well detailed, I was able to clone epics with their issues, but for the step of cloning the subtasks of the issues present in the epic, what happens to me is that when I clone the subtasks through the second automation rule, these subtasks are linked to the initial issue and not to the new cloned one, for example:

- Epic 1
  -Issue A
  -Issue B
    - Subtask 1
    - Subtask 2

When cloning it is as follows, the original epic:
- Epic 1
  -Issue A
  -Issue B
    - Subtask 1
    - Subtask 2
    - Clone of Subtask 1
    - Clone of Subtask 2

The new cloned epic
- Clone of Epic 1
  - Clone of Issue A
  - Clone of Issue B

The problem is that when cloning the subtasks they are linked to the original issue (Issue B), and I couldn't find a way to assign those subtasks to the new cloned issue (Clone of Issue B).

In the case of cloning epic and its issues, there is a condition that changes the EpicLink of the new issues.

At the moment I have not found how to make that relationship for the subtasks with the new cloned issue.

  

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 26, 2022

Hi @sama mohamed / @Iván Muñoz 

Here are screen shots of the two rules:

RULE 1 - Clone Epic and Stories

2022-08-26_06-04-46.jpg2022-08-26_06-06-37.jpg2022-08-26_06-06-44.jpg

The key aspects of this 2022-08-26_06-09-50.jpg

The key pieces to this rule are:

  1. Establishing a link to the template issue so we have an anchor for each issue to find relevant sub-tasks (we'll remove this later)
  2. Adding a label so automation can identify which issues it needs to act against (also removed later)

Rule #2 - Clone Sub-Tasks

2022-08-26_06-18-57.jpg

2022-08-26_06-06-28.jpg

So explanation on the second rule:

  1. Triggers off of the added label which is on the template issue
  2. Performs a lookup to find its newly created clone
  3. Branches into each sub-task
  4. Clones each sub-task... A couple of notes on this one:
    1. I'm explicitly setting the issue type to Sub-Task in the clone action so I can specify the parent issue otherwise the sub-task gets created under the existing issue.  This is why we added the lookup action above
    2. SUB-TASKS CAN ONLY BE CLONED TO THE SAME PROJECT - So, if you're looking for something where the template can be cloned to other projects, it's going to get a lot more complicated
  5. Cleans up the label and link - If we don't add this, weird duplication can occur in the future.
Like James Cooper likes this
sama mohamed August 26, 2022

@Mark Segall thank you so so much for your effort the rule has finally worked as charm :))) that was so helpful, I can't imagine, and thank you for explaining the logic behind it.

 

@Iván Muñoz Hi Ivan, please follow the steps that Mr.Mark has written, it will work perfectly but a small note here, in the yellow arrow please put the cloneAction label in (Values to add not in Values to delete) in order for it to work 

image.png

Like Mark Segall likes this
Iván Muñoz August 26, 2022

Hi @Mark Segall  and @Sama Mohamed

I already get working the automation, with this I can move forward in my processes and save a lot of time manually cloning epics/issues/subtasks, thanks a lot.

One more question..


From what I see the cloning process or cycle is done in parallel, I was looking for a way that when cloning an epic, the order of the issues/subtasks was the same as that of the original/template.

At this time in some it does and in others it doesn't for example:
-Epic 1
    -Issue A
    -Issue B
        -Subtask 1
        - Subtask 2

The new cloned epic
- Clone of Epic 1
    - Clone of Issue B
        -Clone of Subtask 2
        -Clone of Subtask 1
    - Clone of Issue A

Do you know of any way in which the cloning cycle is done in ascending order based on the Issue ID?

Thank you very much in advance for the help.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 29, 2022

Hi @Iván Muñoz - Unfortunately, automation sequencing is largely out of control and there are a number of threads about this in the community.

The alternative is a 3rd party app like bulk clone or deep clone.

Sama mohamed November 2, 2022

 Hello, @Mark Segall 

I would like to ask you if this can help in making our cloning in sequence:

to add the sorting function to our variables or smart values: 

like this for example:

.sort(name, "DESC")

will this work to clone subtasks or tasks in sequence?

Sama mohamed November 2, 2022
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 3, 2022

Hi @Sama mohamed  - That link is for an open suggestion which would indeed be a nice feature add, but sadly it's only a suggestion at this time.

asitterly January 14, 2023

What if the epic I would like to clone contains linked issues in other projects. Anything special I would need to include in the automation so the new epic also contains the cloned issues in those other projects?
We use company based projects.

Thanks!

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 28, 2022

Hi Sama,

Not that I am aware of. But it will be well worth your money in my opinion.  :-)

Suggest an answer

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

Atlassian Community Events