This article shows how you can sync Epics. 

Synchronizing Epics and stories, while keeping the parent-child relationship on the remote side is a common use case which is possible to achieve using Exalate.

The epic name is required when creating an epic on the receiving side. Therefore it's important to include epic names when syncing. 

Add scripts below into the Sync Rules of the previously created Connection to sync Epic.

You should sync stories inside an epic separately before syncing epic issue itself. It's important to keep the Epic Link synced.

Sync epics on JIRA Cloud

Source side

Outgoing sync (Data Filter)

Add the following code to send the epic, including epic name

replica.type           = issue.type
replica.customFields."Epic Name" = issue.customFields."Epic Name"
replica.customFields."Epic Link" = issue.customFields."Epic Link"


Destination side

Incoming sync (Create/Change Processor)

if(replica.type.name == "Epic")
	issue.customFields."Epic Name".value = replica.customFields."Epic Name".value
if(replica.customFields."Epic Link"?.value)
    issue.customFields."Epic Link".value = 
    nodeHelper.getLocalIssueFromRemoteUrn(replica.customFields."Epic Link".value).key
 

Sync epics on JIRA Server 

Source side

Outgoing sync (Data Filter)

Add the following code to send the epic, including epic name

replica.type           = issue.type
replica.customKeys."Epic Id" = issue.customFields."Epic Link".value?.id
replica.customFields."Epic Name" = issue.customFields."Epic Name"

Destination side

Incoming sync (Create/Change Processor)


if(replica.type?.name == "Epic"){
	issue.customFields."Epic Name"?.value = replica.customFields?."Epic Name"?.value
}
if(replica.customKeys?."Epic Id"){
	nodeHelper.updateEpicLink(issue, replica.customKeys."Epic Id" as Long)
}