Unable to map custom fields Zendesk <> Jira

Originally asked by Support on 21 March 2023 (original question)


I am trying to perform an integration between Jira and Zendesk, and on both sides I have the Exalate tool installed. On Jira side there is a premium plan, while on Zendesk side, it is the free plan since we are only exploring the integration possibility. The connection between the two tools was made by generating an invitation in Jira, and accepting the same in Zendesk. Now, we are trying to perform the mapping between the fields in Jira and Zendesk, by using the Exalate add-on in Zendesk > Connections > Edit connection > Rules > Add mapping.

What we have noticed is that some fields from Jira are not available in the selection dropdown. For example, on the Jira Project on which we have performed the connection, we have an “Org” dropdown custom field, and we would like to map it with the “Organization” drop down from Zendesk. However, “Org” Jira field is not available for selection, yet,“ Organization” Zendesk field it is.


Answer by Javier Pozuelo on 27 September 2023

Hello,

I would advise you create a script type connection in Exalate. Create a custom field in Jira type "Select List (Single choice) and a custom field Dropdown in Zendesk.

Add the following code on the Outgoing Sync for both instances

replica.customFields."Organization" = issue.customFields."Organization"

Add the following code on Zendesk Outgoing sync.

You need to change the values of the “organizationMapping” to the name of your organizations.

def organizationMapping = [
   "Organization 1":"organization_1",
   "Organization 2":"organization_2",
   "Organization 3":"organization_3"
   ]
def remoteOrganization = replica.customFields."Organization".value.value

issue.customFields."Organization".value = organizationMapping[remoteOrganization]

Add the following code on Jira Outgoing sync

You need to change the values of the “organizationMapping” to the name of your organizations.

def organizationMapping = [
   "organization_1":"Organization 1",
   "organization_2":"Organization 2",
   "organization_3":"Organization 3"
   ]
def remoteOrganization = replica.customFields."Organization".value.value

issue.customFields."Organization".value = organizationMapping[remoteOrganization]

Important note: Zendesks add an underscore between words in their dropdown values. So for example, if one of your organizations in Zendesk is “Jira Cloud”, the value would be = “jira_cloud”. The value would stay the same in Jira (Organization name = “Jira Cloud”, value = “Jira Cloud”)

Kind regards,

Javier Pozuelo