Link Epic of current ticket to the new ticket in Create issue(s) (JMWE app) post-function.
This article explains how to link the Epic of the current ticket 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 target = []%} {% set epicKey = issue | epic("key") | field("key") %} {% if epicKey %} {% set val = {"type": {"name":"Blocks"}, "inwardIssue": {"key": epicKey} } %} {% set unused = target.push(val) %} {% endif %} {{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 a ticket, a new ticket is created with your configured details and then linked to the current ticket’s Epic.
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.