Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,523
Community Members
 
Community Events
184
Community Groups

Clone Epic, Stories and Subtasks tree with Jira Automation

Currently, there is no way to directly clone the stories and subtasks under an Epic in Jira. Indeed there is a feature request in place to add this functionality:

As a workaround, you can use Jira automation to solve this problem. For this, you will need to create the next two automation rules in your project:

1st Rule. Clone the Epic and the child issues

Clone the Epic

1.png

Save the epic ID

2.png

Clone each child linking the new issue to the new Epic, and append the original issue key to the newly created issue; this will help to identify the issue in the next rule to clone the subtasks.

3.png

 

2nd Rule. Clone subtasks.

Since the result of the 1st rule will trigger this new rule, you need to enable the checkbox shown below:

4.png

Create a variable to know from which original issue the new issue was cloned.

5.png

smart value: {{issue.summary.replaceAll("(.*key:)","")}}

Remove the old key from the summary string:

6.png

smart value: {{issue.summary.replaceAll("(key:.*$)","")}}

Look for subtasks from the original issue:

7.png

Clone each subtask, selecting the trigger issue as the parent:

8.png

If you need to clone the issue links or the attachments you can add the fields in the clone action as follows:

Screen Shot 2023-03-30 at 10.49.24.png

Please note some elements can't be cloned, like the history, comments, or logged time.

I hope that this article is useful for you and helps to improve your team's productivity using Jira and Jira Automation.

4 comments

Thanks for this article @Jorge H 

We have looked for a way to to this for some time (without an add on) and have done so using the REST API quite successfully with the option to clone to a differant project, set due date or assignee based on user requirements ...

Thanks for this too :)

Jorge H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 06, 2023

Thanks a lot for your feedback @Yatish Madhav. I hope you and many of our customers can benefit from this solution.

BR,

Jorge Herrera

@Jorge H I'm so glad you posted this! I have the first part working just fine - the create epic and all child issues. But I'm stumped on the subtask piece. I've copied everything you have but no subtasks are created. One caveat, I am using a custom subtype - "Sub-Testcase" but it is a subtask issue type.  Please help. I'm banging my head over here as I can't figure out what is wrong. When I check audit log too, it says successful but no subtest cases created.  Thanks so much!Automation-JIRA (1).pngAutomation-JIRA (2).pngAutomation-JIRA (3).pngAutomation-JIRA (4).png

Jorge H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 08, 2023

Hi @Kelli Frattini-Adams,

I hope you are having a great day!

I see the regex to extract the original issue is not correct, I should be:

smart value: {{issue.summary.replaceAll("(.*key:)","")}}

And as per your snapshots, I see you are using the one to fix the summary (which is basically opposite to the other smart value).

Please, let us know if this has solved your problem.

BR,

Jorge

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events