Sync organization from Zendesk to Jira

Originally asked by Juan Grases on 09 July 2020 (original question)


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


Answer by Juan Grases on 09 July 2020

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

Comments:

Andy Vander Meulen commented on 30 April 2021

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.

Ariel Aguilar commented on 01 May 2021

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

Andy Vander Meulen commented on 03 May 2021

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.

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