Confluence has been updated to ver 6.15.9. In case of any troubles, please contact infra team.

How to keep parent-child relationship between Azurenode and Jira

 
1
0
-1

How I can get the issue Links on the AzureDevops? I created an Epic, a task and I linked the Task as a Child of the Epic. but, I don't know how to get that information in the script. I'd like to send that information to a Jira Cloud instance. My objective is transfer that information to Jira Cloud, in order to have the same hierarchy structure. I found documentation to get linkIssues between Jira Server instances (https://docs.idalko.com/exalate/display/ED/How+to+synchronize+issue+links+on+Jira+Server). but it's not working to my case. Could you help me with that?

    CommentAdd your comment...

    1 answer

    1.  
      3
      2
      1

      To send that information from azure, you will do:

      replica.parentId = issue.parentId


      The more complex part happens in the Jira side incoming script. If you want to represent that info on issue links, first you will need to get the local issue linked with the parent work item from azure:


      def localParentKey = nodeHelper.getLocalIssueKeyFromRemoteId(replica.parentId)

      Then, you will want to create an issue link with it, something like this:

      def localParentKey = nodeHelper.getLocalIssueKeyFromRemoteId(replica.parentId)
      if(localParentKey){
        httpClient.post("/rest/api/3/issueLink", """{"outwardIssue": "${localParentKey.id}", "inwardIssue": "${issue.id}", "type": {"name": "Relates"}}""")
      }

      If instead of issue links, you want to use an epic link (assuming the parent issue is an epic in Jira):\

      def localParentKey = nodeHelper.getLocalIssueKeyFromRemoteId(replica.parentId)
      if(localParentKey){
        issue.customFields."Epic Link".value = localParentKey.urn
      }


      I haven't tried this scripts yet, let me know how it goes.

      1. Michael Domingues

        Epic link works perfectly.
        but the link code not.. I'm still trying

        Now, on the Jira Cloud side, I'd like to put a Parent issue.
        I created a issue of type History and a issue of type Task. I want the Task type to be a child of the issue History.
        I tried using 

        issue.customFields."Parent".value = localParentKey.urn

        but, it doesn't work.

        How I could do it?

      2. Juan Grases

        Do you have a custom field named "Parent" if so, which kind of custom field is? When you say the task to be a child of issue history, do you mean that task is a "Sub-task" issue type? In that case you might do:

        def localParentKey = nodeHelper.getLocalIssueKeyFromRemoteId(replica.parentId)
        if(localParentKey){
          issue.parentId = localParentKey.id
        }

        This is how you set parent ids to subtasks.

      3. Michael Domingues

        Yes, it's about "sub-task". 
        It's working now. 
        Thank you

      CommentAdd your comment...