I want to build an automation that creates a task and subtasks
Asked by Andrew Kwong:

HI, I've built an automation that clones an issue from one project to another and creates subtasks based on information from a portal request. In my initial version of the automation, I had static subtask names/descriptions such as "Men's Department cleanup!" and "See Action Plan Description" respectively.

I'm trying to have my automation have dynamic subtask names/descriptions. I've linked the fields and thought that I made the relevant changes but I seem get an error message in the audit log that "Issues with this Issue Type must be created in the same project as the parent." I'm confused as this was not a problem when I had the static subtask names. Screenshot of one of my broken components and of the cloned case with static subtask names.

![Screenshot 2023-07-13 174709.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/268769iA38A14F4D192D831/image-size/large?v=v2&px=999 "Screenshot 2023-07-13 174709.jpg")![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/268770i7B70707E4FC5F143/image-size/large?v=v2&px=999 "Capture.PNG")


Answers:
author: Trudy Claspill
body: Hello [@Andrew Kwong](/t5/user/viewprofilepage/user-id/5256750)

For the benefit of others, can you confirm that this relates to your previous post?

<https://community.atlassian.com/t5/Jira-Work-Management-Questions/Automation-to-clone-an-issue-into-a-different-project-and-create/qaq-p/2415105>

Can you show us all the steps in the Automation rule, including the Trigger step.

Also, please share the details of the Audit log for the execution that failed.

What is the project scope of this rule? You said you are cloning issues from one project to another. Is the scope for this rule set to Multiple Project and naming both the source and destination project?

comments: author: Andrew Kwong
body: Yes, this relates to that post. I'm trying to build off of that. I've been trying a few fixes that seem to work, but only if 8/8 conditions are met. I then tested with certain conditions failing but the automation seems to break (issue cloned but zero subtasks created.) I tried reordering my components, but this doesn't seem to have fixed my issue. Screenshots attached of the top half of the automation; the bottom half is the same with more components.

![Automation 3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/268985i2B2244D9989617AE/image-size/large?v=v2&px=999 "Automation 3.PNG")![Automation 2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/268983i3A2EDCB0568B0C70/image-size/large?v=v2&px=999 "Automation 2.PNG")![Automation 1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/268984i4E99AF68F7081E07/image-size/large?v=v2&px=999 "Automation 1.PNG")


author: Trudy Claspill
body: Please show us the details of the Audit Log for an execution that did not give you the results you expected, and explain how the results diverged from your expectations.


author: Andrew Kwong
body: Hi Trudy, I've attached details of the audit log for the automation that did not give me the expected results.

I've built a request form with multiple sections. Each of these sections essentially has a pass/fail question and two follow-up questions that generate fields that generate fields and a sub task in the cloned issue.

For my test, I've had the first question "pass" and the following questions "fail."

Actual Results: The issue is successfully cloned into a second project but zero sub tasks are created for the "fails"

Expected Results: Ideally, the issue should clone into the new project and there should be sub tasks in the cloned issue for each of the "fails."

I'm stuck as to how to frame the automation to allow for both "passes" and "fails" without breaking every component after a "pass"

![Audit Log.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/269324i6A80337AD7B5CE44/image-size/large?v=v2&px=999 "Audit Log.PNG")![Automation 3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/269325i1CBC8E40820198F4/image-size/large?v=v2&px=999 "Automation 3.PNG")![Automation 2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/269326i7B24EE367C3173B7/image-size/large?v=v2&px=999 "Automation 2.PNG")![Automation 1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/269327i1C9DF14CF7984C9D/image-size/large?v=v2&px=999 "Automation 1.PNG")


author: Andrew Kwong
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) , any ideas for this automation? Thanks!