2
1
0

How can I sync the organization from zendesk to Jira if the names match?

    CommentAdd your comment...

    1 answer

    1.  
      3
      2
      1

      Outgoing Zendesk:

      def orgId = issue.organization_id 
      if(orgId){
        def orgName = httpClient.get("/api/v2/organizations/"+(long)orgId+".json").organization.name
        replica.customKeys."Organization" = orgName
      }


      And then in Jira Incoming:

      issue.customFields."Organizations".value = replica.customKeys.Organization
      1. Andy Vander Meulen

        I haven't been able to get this to work. I have a custom field in Jira called "Org." When I replace "Organization" in the outgoing and incoming script with "Org" I get a Connection Configuration error.

      2. Ariel Aguilar

        Hi Andy,


        You say you replaced "Organization" to "Org." in outgoing and incoming script, but it should've only been done in the incoming script:


        issue.customFields."Org.".value = replica.customKeys.Organization

        Leave the Outgoing the same way,


        def orgId = issue.organization_id 
        if(orgId){
          def orgName = httpClient.get("/api/v2/organizations/"+(long)orgId+".json").organization.name
          replica.customKeys."Organization" = orgName
        }


        Let me know if now works,

        Thanks,

        Ariel

      3. Andy Vander Meulen

        I would assume when your refer to Outgoing, that I would add the script in the Zendesk Connection and Incoming would go to the Jira Connection. When I add one in either place, it shows up on the other one, so I am confused as to whether or not that is the correct place to add it. Is there a way to add a script so that it only shows up in one or the other?


        This is how I have it configured in Jira.


      CommentAdd your comment...