How to copy remote links (Web Link) using Create / Clone Issue(s) Post-function
When using the Create / Clone Issue(s) Post-function, there is no option to copy the remote links to the newly created issues. This article explains how you can copy over remote links (Web Links) from the source issue to the target issue(s) using a Groovy script.
Instructions
Navigate to the workflow you wish to change and enter edit mode.
Select the transition you wish to edit.
Click the Post functions tab.
SelectÂ
Create / Clone Issue(s) Post-function
 from the list of post-functions.ClickÂ
Edit
to edit the post-function on the transition.Select the Run a Groovy script after the issue is created checkbox under Post-creation script
Add the following code in Post-creation script:
import com.atlassian.jira.bc.issue.link.RemoteIssueLinkService import com.atlassian.jira.issue.link.RemoteIssueLink RemoteIssueLinkService remoteIssueLinkService = getComponent(RemoteIssueLinkService.class); List<RemoteIssueLink> remoteLinks = issue.getRemoteLinks(); for (link in remoteLinks) { newIssue.addRemoteLink(link); }
Save the post-function.
Publish the workflow.
When you trigger the post-function, you will now see that newly created issue(s) have your remote links copied over from the source issue:
Â