Clone task and sub-task from an existing Project with Automation
Asked by Shirley Wee:

I would like to clone task and sub-task from an existing Project with the condition that the Project Category is Project Management.

I tried to set up this Automation but it seems to have an issue cloning task over to the target Project.

![jira.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/247828iC1F1AA5B6FDB6310/image-size/large?v=v2&px=999 "jira.JPG")


Answers:
author: Trudy Claspill
body: Can you provide the details from the Audit Log for an execution of the rule?

comments: author: Shirley Wee
body: Here is the details from the Audit Log:

![audit log.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/247829i88216422F6F1F89E/image-size/large?v=v2&px=999 "audit log.JPG")


author: Trudy Claspill
body: Can you show us the details of the Clone Issue actions?

Is this project a Company Managed project or a Team Managed project? That information will show at the bottom of the navigation panel on the left when you are viewing the project.

Is the project a Software, Service, or Work Management project? If the navigation options are displayed horizontally across the top of the screen (i.e. List, Board, Calendar, Timeline, etc.) then it is a Work Management project.

Based on your first For JQL branch it seems like you might be trying to clone multiple Tasks and their sub-tasks. Is that true?


author: Shirley Wee
body: The project is a Team Managed Project in JIRA Work Management. I am using automation to clone multiple tasks and their sub-task from one project to another project. I have also tried a new automation rule and managed to clone the Task but not the sub-task due to an error when cloning "Issues with this Issue Type must be created in the same project as the parent. (project)")


author: Shirley Wee
body: ![Clone Task.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/248083i99503568933CA072/image-dimensions/352x232?v=v2 "Clone Task.jpg")![Clone Sub-task.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/248082iFBE729A84DD2AF05/image-dimensions/299x234?v=v2 "Clone Sub-task.jpg")

![Automation.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/248081iA147DC6EFBA1EE6E/image-dimensions/145x276?v=v2 "Automation.jpg")

Error encountered:

![error.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/248080i204E1340264C455C/image-dimensions/354x47?v=v2 "error.jpg")


author: Trudy Claspill
body: Are both the source and destination projects Team Managed?

Does the Rule Scope name both the source and destination projects?

The original error could've come about because in Team Managed projects all the configuration elements have unique identifiers. In the Clone task if you selected Task for the issue type before you selected the destination project then the rule would be picking up the ID (10002) for a Task issue type from the source project. The ID for the Task issue type in the destination project would be different. With Team Managed projects you need to select the destination project first, then the issue type.

Regarding cloning subtask into a Story in a different project, I'm sure that has been discussed before in community posts. I will see if I can find the relevant posts and add the links here.

I think it involves

1. creating a variable to hold the ID of the new Story you created through cloning.

2. Cloning the subtasks, but leaving them cloned into the same original issue.

3. Editing the subtasks created by cloning to change their Parent Link to be the issue ID of the new Story you created through the previously cloning step.


Tags: automation

cloud

sub-task

task