1
0
-1

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 

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      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.


      1. Howard Kenny

        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.

      CommentAdd your comment...
    2.  
      1
      0
      -1

      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?

        CommentAdd your comment...