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

Clone issues and all their subtasks

Kelli Frattini-Adams April 26, 2023

 

I am trying to have a template of Epics, tasks and custom subtasks (Sub Test-Case), that I can clone by manually triggering an automation. I have the Epics being cloned and all child stories/tasks in one rule. But I am stumped with the second rule of creating the subtasks into the new created epic/issues. Please help! This is driving me mad. I've seen lots of posts on this but no real solution, at least not one that I'm following.

 

Automation-JIRA (6).pngAutomation-JIRA (5).pngAutomation-JIRA (7).png

3 comments

Stephen Wrathall
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2023

Hi @Kelli Frattini-Adams

Doing a full deep-clone of Epics -> Tasks/Stories -> Subtasks is possible with Automation. It's not possible within a single rule because it requires 2 levels of branching, and only 1 branch is supported per rule. 

So the solution at a high level involves:

  1. Rule 1: Cloning the Epic and all of it's Tasks/Stories
    1. While doing this, adding a temporary label to those newly-created Tasks/Stories
  2. Rule 2: Cloning those newly-created Tasks/Stories's subtasks, based on the temporary label that was added.

If you don't set up the variables correctly, you can end up setting the wrong parent issues, or epic links. However both the solution, and examples of pitfalls are all covered in this lengthy community post here:

https://community.atlassian.com/t5/Jira-Software-questions/Re-Re-clone-an-epic-including-its-child-issues/qaq-p/2118393/comment-id/214327#M214327

Some scenarios aren't supported, e.g. cloning into difference Jira projects. If you have more complex requirements such as that, you may want to consider 3rd party apps like bulk clone or deep clone. 

I hope this helps.

Regards,
Stephen

Like # people like this
Kelli Frattini-Adams May 2, 2023

@Stephen Wrathall Thank you for this. I am so close but still don't have it working properly. I copied both Rule 1 and 2. My only change is I have a custom subtask issue type, called Sub-Test Case. I finally am getting the sub-test cases cloned but in the original Tasks, not the newly cloned tasks. Can you please take a look? Where am I going wrong? 

Automation-JIRA 1.pngAutomation-JIRA (9).png

Kelli Frattini-Adams May 5, 2023

@Stephen Wrathall  Please help! I'm not sure what is wrong with this and why issues are still being created in original tasks, not cloned tasks.

Stephen Wrathall
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2023

Hi @Kelli Frattini-Adams

That's the same challenge faced here:

https://community.atlassian.com/t5/Jira-Software-questions/Re-clone-an-epic-including-its-child-issues/qaq-p/2117788/comment-id/214213#M214213

I would be trying the same as what they've done there.

My best guess as to why it's not working in your example is the Branch that you're using is "For JQL: IssueType = 'Sub-Test Case'". And so {{lookupIssues}} isn't resolving to the right issue inside your branch.

As in that other post, try using the "For Sub-tasks" branch. 

If that's not possible, then that might be related to your custom sub-task type. I wouldn't be surprised if "For JQL" doesn't set the same smart values as "For Sub-tasks", in which case it might not be possible.

Regards,
Stephen

Luka Hummel - codefortynine
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 15, 2023

Hi @Kelli Frattini-Adams

Have you managed to set up your automation? This can be quite tricky. If you are still facing problems I want to suggest, as @Stephen Wrathall was already so nice to mention, our Deep Clone for Jira app. With it, you can also clone your template hierarchy across instances or clone a whole project.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events