Looking to maintain Epic/Story/Sub-task relationship for syncs between JIRA server and Azure Devops

Originally asked by Maggie Stearns on 02 February 2023 (original question)


Hello:

I am looking to sync Epics and Stories from a Jira server to Azure Devops and maintain the parent/child relationship. I don’t need to sync from Azure Devops to JIRA. I just need a one-way sync from JIRA to Azure DevOps.

I was told this might work, but it does not. It does work for sub-task that have a parent Story, but not for Stories that have a parent Epic.

Outgoing JIRA:

replica.parentId = workItem.parentId 

Incoming Azure Devops:

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

Any help would be greatly appreciated.


Answer by Mathieu Lepoutre on 03 February 2023

Hello,

For sub-tasks and parents, the code you provided is perfect to sync over this information.

With regards to Epics, it is necessary to incorporate the Epic scripts into the library in order to transmit all relevant information.

For further information about how to do this, please refer to the accompanying documents.

https://docs.exalate.com/docs/how-to-sync-epics-in-jira-on-premise

https://docs.exalate.com/docs/how-to-add-an-external-script-in-jira-on-premise

Thanks, let me know how it goes.

Cheers


Comments:

Maggie Stearns commented on 06 February 2023

I can add that groovy script to my JIRA server (and then restart I assume). Next, I can add this to the JIRA outgoing connector:

Epic.sendEpicFirst()

On the ADO side, what do I put on the incoming side? I assume not this since ADO won’t know about that right?

Epic.receive()

()

Maggie Stearns commented on 10 February 2023

I am all set now. Thank you.

This was the portion I didn’t have on the ADO side:

if (replica.customKeys.“Epic Link”?.id){
def localParent = syncHelper.getLocalIssueKeyFromRemoteId(replica.customKeys.“Epic Link”.id.toLong())
if(localParent){
workItem.parentId = localParent.id
}
}