Syncing Epic to Story relationships between Azure and Jira Software

Originally asked by Howard Kenny on 21 November 2020 (original question)


Hey,

I’ve read this part of the Jira documentation, but I’m unsure whether this will work for Azure DevOps. Can you advise please?

Cheers,

Howard


Answer by Juan Grases on 21 November 2020

You could try something like this:

Azure to Jira Server

Azure sending side:

I have seen that the child issue has a field that has the id of the parent of the value, you can get any field of azure you see on the REST API json, but also we map the ‘System.Parent’ field to workItem.parentId

replica.parentId = workItem.parentId

It might be the value you are looking to sync its stored in a different field, just use the right field name instead of parentId

Jira receiving side:

Imagine the Epic was already synced, now you are receiving the sync of the child issue, you can do something like:

def remoteParentId = replica.parentId
if(remoteParentId){
  issue.customFields."Epic Link".value = syncHelper.getLocalIssueKeyFromRemoteId(remoteParentId, "issue")
}


I have not tried this yet so let me know how it goes.

Jira Server to Azure

Jira sending side:

We send the epic as the parentId, if this is a subtask, we will send the parent issue:

//Outgoing Jira Server
replica.parentId = issue.customFields."Epic Link"?.value?.id ?: issue.parentId

Incoming Azure side:

//Incoming Azure
def remoteParentId = replica.parentId
if(remoteParentId){
  issue.parentId = syncHelper.getLocalIssueKeyFromRemoteId(remoteParentId, "issue")?.id
}

This should work.


Comments:

Howard Kenny commented on 22 November 2020

It’s actually Azure that’s the receiving side.

I’m using the Rest API JSON to find all the fields I need, however there doesn’t appear to be such a field which shows the parent/child/link. In Azure, they’re under Related Work and are classed as Links, but still there’s nothing obvious in the JSON which shows these - I’ve checked the Epic and the PBI (child) JSON.

Answer by Shubham Chaudhary on 02 February 2021

Hi All,

I have tried this solution but getting following error

Error Type:Outgoing script error

Error Detail Message:No such property: id for class: java.lang.String

Could someone help?


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.