Our new Appfire Documentation Space is now live!
Take a look here! If you have any questions please email support@appfire.com
Copy linked issues(of a specific link type) from current issue to new issue in Create / Clone issue(s) (JMWE app)
This article explains how to link the issues linked to the current issue (through a specific link type) to the new issue in Create issue(s) (JMWE app) post-function.
Instructions
Navigate to the intended workflow to make the necessary changes in the edit mode.
Select the required transition.
Select the Post functions tab and click
Add post function
.Add the “Create issue(s) (JMWE app)” 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 isBlockedByKeys = issue | linkedIssues("is blocked by") | field("key")%} {% set target = []%} {% for key in isBlockedByKeys %} {% set val = {"type": {"name":"Blocks"}, "inwardIssue": {"key":key} } %} {% set unused = target.push(val) %} {% endfor %} {{target | dump(2)}}
The above code :
Retrieves the issues linked to the current ticket through
is blocked by
link type (line #1)Loops through the retrieved issues and adds them to the array in the expected format(lines #3 to #6) [modify the link type name. Use either
inwardIssue
oroutwardIssue
in line #4 as per your use case]Returns the result in the expected format
With this, the issues linked to the current ticket through is blocked by
link type will be linked to the new ticket through is blocked by
link type. Modify the link type names as per your use case.
References