JIRA SERVER

This article shows how to create a real JIRA link between the source and a destination issues in local connection. The link remains even if the issue has been Unexalated.

By default, the Exalate app displays a remote issue link on the Sync panel, but once you 'Unexalate' an issue, the sync panel will be removed from the issue view. 

In some cases it would be handy to keep the remote issue link on the source issue, even if the synchronization is finished.

It could be achieved with the help of Jira Server API and Exalate external scripts library.

In local connection you have only one set of the Sync Rules for both sides. More details.

1. Upload the file 

Upload the files into the $JIRA_HOME/scripts directory.

2. Add scripts to the Sync Rules

Outgoing sync(data filter) 

replica.key           = issue.key

Incoming sync for new issues(create processor)

return CreateIssue.create(
  replica,
  issue,
  relation,
  nodeHelper,
  issueBeforeScript,
  remoteReplica,
  traces,
  blobMetadataList){
   LinkIssuesLocalSync.addLink(
        "Escalated from", // Replace the value with the relevant link type name: you can find it in your Jira issue linking settings
        replica,
        issue,
        connection
   )
   return null
}


Example


The remote issue link displays on the Sync panel and in the Issue Links section

The remote issue link remains in the Issue Links section (the issue is not under sync anymore)