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 post-function.

 Instructions

  1. Navigate to the intended workflow and open it in Edit mode.

  2. Select the required transition.

  3. Select the Post functions tab and click Add post function.

  4. Add the post-function.

  5. Fill in the required details.

  6. 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 either inwardIssue or outwardIssue in line #4 as per your use case.

  7. 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.

Create issue(s) JMWE post-function

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.