Link sub-task(s) of current ticket to new ticket in “Create / Clone issue(s) (JMWE)” post-function

This article explains how to link sub-tasks(s) of the current ticket, if any, to the new ticket in Create / Clone issue(s) (JMWE) post-function.

 Instructions

  1. In Jira Administration, go to Workflows and click the Edit link of the desired workflow to open it.

  2. Select the required transition.

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

  4. Select the “Create / Clone issue(s) (JMWE)” post-function and click Add.

  5. Fill in the required details.

  6. Under the Post-creation script section, select the checkbox Run a Groovy script after the issue is created checkbox and then enter the following in the Post-creation script text box:

    for(subtask in issue.subTaskObjects) newIssue.linkIssue("is blocked by",subtask)

Note: You should replace “is blocked by” with whatever link type you wish to use.

When the transition is executed on a ticket, a new ticket is created with your configured details and then linked to the sub-tasks of the current ticket (if any).

 

References