How to generate automatically linked tasks and subtasks when creating an epic?
Asked by Benjamin Locher:

Hi all

I'd like to to automise the following process:

If I create an epic and set the value of a custom field \[Generate CR\] on a certain status \[General\], several \[6\] linked tasks should be generated.

Two of those six tasks should also contain several linked subtasks \[not defined how many yet\].

Now my automation works so far, that all tasks are generated and linked to the specific epic.

But I cannot make it work to get the substasks created and linked to the specific task.

How can I fix this automation?

I'd prefere to have it in one automation and not an additional one.

Below some screen shots:

![image.png](/t5/image/serverpage/image-id/331007iA73A139F851A37E4/image-size/large?v=v2&px=999 "image.png")![image.png](/t5/image/serverpage/image-id/331008i1C92313CD1CD648A/image-size/large?v=v2&px=999 "image.png")![image.png](/t5/image/serverpage/image-id/331009i214012E206226D3B/image-size/large?v=v2&px=999 "image.png")![image.png](/t5/image/serverpage/image-id/331010i566673E44748DCE3/image-size/large?v=v2&px=999 "image.png")![image.png](/t5/image/serverpage/image-id/331011i87B9C132B29F81C0/image-size/large?v=v2&px=999 "image.png")![image.png](/t5/image/serverpage/image-id/331012i6FFEA7BC06EE7314/image-size/large?v=v2&px=999 "image.png")![image.png](/t5/image/serverpage/image-id/331013i163BE9331A0947D4/image-size/large?v=v2&px=999 "image.png")

Thanks a lot for your support.

Cheers


Answers:
author: Phil Arnold
body: Hi,

I have done something similar and they way it works for me is to select the field "Parent" on your Create Task step in the automation:

![create task.png](https://community.atlassian.com/t5/image/serverpage/image-id/331019i55558B16C2430AF0/image-size/large?v=v2&px=999 "create task.png")

I then set the field like so:

![create task 2.png](https://community.atlassian.com/t5/image/serverpage/image-id/331020i2E611DCD8FDE760C/image-size/large?v=v2&px=999 "create task 2.png")

comments: author: Benjamin Locher
body: Hi Phil

Thanks for your comment.

To clarify: the automation works for the tasks but not for the subtasks.

I've now added a branch and it was possible to generate the subtask automatically.

The only thing what not works is to link subtask to the task.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/331028iCA6715C4ACAE59D7/image-size/large?v=v2&px=999 "image.png")

Cheers


author: Phil Arnold
body: ah, I understand.

If you want to name your subtasks differently for each task then give this a try:

![create task 3.png](https://community.atlassian.com/t5/image/serverpage/image-id/331037iF7F2D90D294151E8/image-size/large?v=v2&px=999 "create task 3.png")

else, you could create subtasks at the end of your automation using something like this:

![create task 4.png](https://community.atlassian.com/t5/image/serverpage/image-id/331039iB80395D00A877F76/image-size/large?v=v2&px=999 "create task 4.png")

![create task 5.png](https://community.atlassian.com/t5/image/serverpage/image-id/331043i9BEAAD76A4EE36D3/image-size/large?v=v2&px=999 "create task 5.png")


author: Benjamin Locher
body: Great, now it works.

Thanks a lot.


author: Phil Arnold
body: Great stuff, glad it works for you


Tags: cloud

jira-cloud