How to sync assignee and Epic link field from Jira on premise to ADO

Could you please share the snippet of syncing assignee and Epic link field from Jira on premise to ADO

Epic link need to be added as Parent-Child relation in ADO side

Current snippet what i used

Jira Outgoing

replica.assignee       = issue.assignee 
replica.customFields."Epic Link" = issue.customFields."Epic Link"`

ADO Incoming

workItem.assignedTo = nodeHelper.getUserByEmail(replica.assignee?.email, workItem.projectKey)
// Sync Epic Link
if (replica.customFields."Epic Link"){
    def localParent = syncHelper.getLocalIssueKeyFromRemoteId(replica.customFields."Epic Link")
    if(localParent){
        workItem.parentId = localParent.id
    }
}

The script above isn’t working.

Hi,

Assignee:
You seem to be using assignedTo. I replaced this by assignee and it worked as expected:
workItem.assignee = nodeHelper.getUserByEmail(replica.assignee?.email, workItem.projectKey)

Epic-Child:
Rather than use the Epic Link (that would use the issue key), use the parentId attribute (that will have the issueId). So,
Jira Cloud outgoing
replica.parentId = issue.parentId (usually part of default outgoing script)

ADO Incoming

if (replica.parentId){
    def localParent = syncHelper.getLocalIssueKeyFromRemoteId(replica.parentId.toLong())
    if(localParent){
        workItem.parentId = localParent.id
    }
}

Please let me know if you have any questions.

Thanks
Majid

1 Like