Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

How to Set automatically web link in Jira cloud that connects to corresponding issue in Github?

 
1
0
-1

How to add automatically web link in Jira cloud that connects to corresponding issue in Github when it syncs from Github to Jira Cloud? 

  1. Support

    Please access Sync Panel in the General Settings, as detailed in the Sync Panel article and let us know if need further assistance.

CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1

    Hi dongyo kang ,


    Can you please try the below code snippet.


    Jira incoming sync


    if(firstSync){
       issue.projectKey   = "XYZ" 
       issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
       issue.summary      = replica.summary

     //include other fields that maybe mandatory for creating the Jira issue.
       store(issue)
    }

    //write the below line outside the first sync block

    httpClient.post("/rest/api/3/issue/${issue.key}/remotelink", """
    {
    "globalId": "${replica.key}",
        "object": {
            "url": "${issueUrl}",
            "title": "${replica.key}"
            }
        }
    }""")

    //here you can paste the other mappings

    issue.summary      = replica.summary
    issue.description  = replica.description
    issue.comments     = commentHelper.mergeComments(issue, replica)
    issue.attachments  = attachmentHelper.mergeAttachments(issue, replica)
    issue.labels       = replica.labels


    No changes are required on the GitHub side. 


    Do let me know how this goes and if you have any questions!.


    Thanks,

    Dhiren

      CommentAdd your comment...