I want to use Jira automation to create a child issue of a child issue
Asked by koutarou ishibashi:

Create a child issue by filling in the following additional fields  
{  
"fields": {  
"Parent Link" : "{{issue.parent.key}}"  
}  
}

<br />

I want to create a child issue of the created issue.  
I want to implement it with one automation  
Please lend us your wisdom on how to implement


Answers:
author: Marc - Devoteam
body: Hi [@koutarou ishibashi](/t5/user/viewprofilepage/user-id/5308713)

You cloud try the following.

{  
"fields": {  
"parent": {  
"key": "{{issue.parent.key}}"  
}  
}  
}

But I'm not sure as I see your rule.

Can you explain in English what all steps are in the current rule?

comments: author: koutarou ishibashi
body: I'm setting up a custom hierarchy.

There are three hierarchy levels: 3, 2, and 1

The parent of 1 is 2 and the parent of 2 is 3

Trigger manually at hierarchy level 1![1.png](https://community.atlassian.com/t5/image/serverpage/image-id/288963iC5D721A8067EEF2E/image-size/large?v=v2&px=999 "1.png")

Custom Fields_10228 is of type Select List (multiple choices).

Repeat the same process for as many as the value of Custom Fields![2.png](https://community.atlassian.com/t5/image/serverpage/image-id/288964iDA38840EB5C58BD5/image-size/large?v=v2&px=999 "2.png")

Create a tier 2 Epic below  
"Parent Link" : "{{issue.parent.parent.key}}"

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

I want to create a story that is a subordinate of the Epic I created.

(I want you to tell me how to do it here)

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


author: Marc - Devoteam
body: Hi [@koutarou ishibashi](/t5/user/viewprofilepage/user-id/5308713)

I don't think this is going to work in the same rule.

As the Story you are creating doesn't know the Epic that is created.

Add an action to re-fetch data

You could look at making 2 log actions between action to create the Epic and the action to create the Story.

Is their information in the log action, you would need to log the information on the issue key and Epic Link.

Then if there is information you should create a variable to log this and use the variable on setting the Epic Link value in the Story

But as I said I don't know if this will work.


author: Michel Neeser
body: Hi [@koutarou ishibashi](/t5/user/viewprofilepage/user-id/5308713)

I think you can achieve your goal with an automation rule like this:

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

comments: author: koutarou ishibashi
body: Thank you for your answer. because of the special environment it cannot be created that way

As you can see in the image, we have created a new issue and created a child issue of the parent parent with "Parent Link" : "{{issue.parent.parent.key}}".

I want to create a child in the issue I created

![jql.png](https://community.atlassian.com/t5/image/serverpage/image-id/288770i5E3891CEB9D07972/image-size/large?v=v2&px=999 "jql.png")![jql2.png](https://community.atlassian.com/t5/image/serverpage/image-id/288771iC1C62323225C9245/image-size/large?v=v2&px=999 "jql2.png")


author: Michel Neeser
body: -


author: Michel Neeser
body: [@koutarou ishibashi](/t5/user/viewprofilepage/user-id/5308713) You have to differentiate between sub tasks and child tasks. The parent/child relationship you're referring to applies to sub tasks. But it seems that you want to create a child task below an epic task. So you have to specify the epic link like this:

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


author: koutarou ishibashi
body: I'm setting up a custom hierarchy.

There are three hierarchy levels: 3, 2, and 1

The parent of 1 is 2 and the parent of 2 is 3

At hierarchy level 2, we have succeeded in setting hierarchy level 3 as the parent

This is resolved

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

Continuing, I don't know how to set the parent of the issue I created

This problem cannot be solved

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


Tags: cloud

confluence-cloud