Link current Epic's child issues(s) to the new ticket in Create issue(s) (JMWE app) post-function.
This article explains how to link the current Epic’s child issue(s) to the new ticket in Create issue(s) post-function.
Instructions
Navigate to the intended workflow and open it in Edit mode.
Select the required transition.
Select the Post functions tab and click
Add post function
.Add the Create issue(s) post-function.
Fill in the required details.
Select the “Linked Issues” field under “Set specific fields of new issue(s)”. Select “Set field value to:” and add the below template:
{% set childIssues = issue | stories("key") | field("key")%} {% set target = []%} {% for key in childIssues %} {% set val = {"type": {"name":"Blocks"}, "inwardIssue": {"key":key} } %} {% set unused = target.push(val) %} {% endfor %} {{target | dump(2)}}
Modify the link type name(
Blocks
in line #4). Use eitherinwardIssue
oroutwardIssue
in line #4 as per your use case.Click Add and publish your workflow.
When the transition is executed on an Epic ticket, a new ticket is created with your configured details and then linked to the current Epic’s child issue(s).
If this post-function is added on the create transition, select the checkbox “Delay the execution of this post-function” under “Delayed execution” and select a delay of 3 seconds.
References
Related articles