outgoing source side.txt
def boardIds = ["50", "80", "130", "144"] //Boards which sprints will get synced
if(entityType == "sprint" && boardIds.find{it == sprint.originBoardId}){
    replica.name = sprint.name
    replica.goal = sprint.goal
    replica.state = sprint.state
    replica.startDate = sprint.startDate
    replica.endDate = sprint.endDate
    replica.originBoardId = sprint.originBoardId
}
if(entityType == "issue"){

	//sprint....
   replica.customFields."Sprint" = issue.customFields."Sprint"
}
incoming destination side.txt
//entityType represent the type of the remote side entity
if(entityType == "sprint"){
    //Executed when receiving a sprint sync from the remote side
    def sprintMap = ["162":"50", "197": "80", "214": "130", "225": "144"] //[remoteBoardId: localBoardId]
    
    sprint.name = replica.name
    sprint.goal = replica.goal
    sprint.state = replica.state?.toUpperCase()
    sprint.startDate = replica.startDate
    sprint.endDate = replica.endDate
    def localBoardId = sprintMap[replica.originBoardId]
    if(localBoardId == null){
       throw new com.exalate.api.exception.IssueTrackerException("No board mapping for remote board id "+replica.originBoardId)
    }
    sprint.originBoardId = localBoardId //Set the board ID where the sprint will be created
}
if(entityType == "issue"){
    //Executed when receiving an issue sync from the remote side
    issue.summary = replica.summary
    if(replica.projectKey == "SCRUM"){
        issue.projectKey = "SCRUM2"
    }
    if(replica.projectKey == "SCRUM2"){
        issue.projectKey = "SCRUM"
    }
     
    issue.typeName = replica.typeName
     
    def sprintV = replica.customFields.Sprint.value?.id.collect{ remoteSprintId ->
        return nodeHelper.getLocalIssueKeyFromRemoteId(remoteSprintId, "sprint")?.id?.toString()
    }.findAll{it != null}
     
    issue.customFields."Sprint".value = sprintV
     
}