# ZenDesk to Jira

**URL:** <https://community.exalate.com/t/zendesk-to-jira/5382>\
**Category:** General Questions\
**Tags:** zendesk, migrated\_question\
**Created:** [November 4, 2024, 8:01am UTC](https://community.exalate.com/t/zendesk-to-jira/5382 "2024-11-04T08:01:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:01am UTC](https://community.exalate.com/t/zendesk-to-jira/5382/1 "2024-11-04T08:01:18Z")

</div>

_Originally asked by Normann P. Nielsen on 22 December 2022 [(original question)](https://oldcommunity.exalate.com/questions/58497935)_

* * *

As the Exalate support just closed my case and reffered me here… here goes:

We are trying to setup sync witha partner that uses Zendesk.

in my incoming I have:

issue.customFields.“Vendor Status”.value = replica.status  
issue.customFields.“Vendor Service”.value = replica.type?.name  
issue.customFields.“Vendor Priority”.value = replica.priority

All fields just being text, so I can see values.

This gives:

- **Vendor Service:**  
problem
- **Vendor Priority:**  
[com.exalate.basic.domain.hubobject.v1.BasicHubPriority@40d79ce0](mailto:com.exalate.basic.domain.hubobject.v1.BasicHubPriority@40d79ce0)
- **Vendor Status:**  
[com.exalate.basic.domain.hubobject.v1.status.BasicHubStatus@684c940](mailto:com.exalate.basic.domain.hubobject.v1.status.BasicHubStatus@684c940)

The last 2 I cant resolve to Jira - I need the values as strings:

def priorityMapping = [“Normal”:“Minor (P4)”, “Low”:“Minor (P4)”,“High”:“Major (P2)”,“Urgent”:“Critical (P1)”]  
def remotePriorityName = replica.priority  
issue.setPriority(priorityMapping[remotePriorityName] ?: remotePriorityName)

The outgoing from ZenDesk:

replica.key = issue.key  
replica.assignee = issue.assignee  
replica.reporter = issue.reporter  
replica.summary = issue.summary  
replica.description = issue.description  
replica.type = issue.type  
replica.attachments = issue.attachments  
replica.comments = issue.comments  
replica.status = issue.status  
replica.priority = issue.priority

Also, is this case sensitive?

issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: “Service Request”

And we have “Problem”, but the incoming is “problem”

* * *

[Failed to download attachment: attachment\_58497935\_mail\_small.gif. Error: 401 Client Error: for url: [https://support.idalko.com/servicedesk/customershim/images/icons/mail\_small.gif?fromIssue=143618](https://support.idalko.com/servicedesk/customershim/images/icons/mail_small.gif?fromIssue=143618)]

[Failed to download attachment: attachment\_58497935\_mail\_small.gif. Error: 401 Client Error: for url: [https://support.idalko.com/servicedesk/customershim/images/icons/mail\_small.gif?fromIssue=143618](https://support.idalko.com/servicedesk/customershim/images/icons/mail_small.gif?fromIssue=143618)]

#### Comments:

> **Serhiy Onyshchenko commented on 23 December 2022**
>
> > Hello, Normann P. Nielsen  
> > Thanks for raising this here.
> 
> > All fields just being text, so I can see values.
> 
> Please, try
> 
> ```auto
> issue.customFields."Vendor Status".value = replica.status?.name
> issue.customFields."Vendor Service".value = replica.type?.name
> issue.customFields."Vendor Priority".value = replica.priority?.name
> 
> ```
> 
> > I need the values as strings:
> 
> please, give this a go:
> 
> ```auto
> def priorityMapping = ["Normal":"Minor (P4)", "Low":"Minor (P4)","High":"Major (P2)","Urgent":"Critical (P1)"]
> def remotePriorityName = replica.priority?.name
> issue.setPriority(priorityMapping[remotePriorityName] ?: remotePriorityName)
> 
> ```
> 
> > Also, is this case sensitive?
> 
> Yes, unfortunately, it is, so you could do a mapping:
> 
> ```auto
> def issueTypeMapping = ["problem":"Problem"]def mappedIssueType = issueTypeMapping[replica.type?.name] ?: replica.type?.nameissue.typeName = nodeHelper.getIssueType(mappedIssueType, issue.projectKey)?.name ?: "Service Request"
> 
> ```
> 
> Please, let me know, how it goes  
> Regards, Serhiy.

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:01am UTC](https://community.exalate.com/t/zendesk-to-jira/5382/2 "2024-11-04T08:01:19Z")

</div>

_Answer by Normann P. Nielsen on 28 December 2022_

hi Serhiy,

Tanks - this was perfect:

```auto
issue.customFields."Vendor Status".value = replica.status?.name
issue.customFields."Vendor Service".value = replica.type?.name
issue.customFields."Vendor Priority".value = replica.priority?.name

```

for the mappings, I use switch to make the code simpler for all to read:

```auto
if(firstSync){
   issue.projectKey = "TEST" 
   // Set type name from source issue, if not found set a default
   switch(replica.type?.name)
   {
       case "incident":
            issue.typeName = "Incident"
            break;
        case "problem":
            issue.typeName = "Problem"
            break;
        default:
            issue.typeName = "Service Request"
    }
}
issue.summary = replica.summary
issue.description = replica.description
issue.comments = commentHelper.mergeComments(issue, replica)
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
issue.labels = replica.labels
issue.customFields."Vendor Status".value = replica.status?.name
issue.customFields."Vendor Service".value = replica.type?.name
issue.customFields."Vendor Priority".value = replica.priority?.name

switch(replica.priority?.name)
{
   case "urgent":
        priority = "Critical (P1)"
        break;
    case "high":
        priority ="Major (P2)"
        break;
    default:
        priority ="Minor (P4)"
}

issue.priority = nodeHelper.getPriority(priority, issue)

```

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 8:02am UTC](https://community.exalate.com/t/zendesk-to-jira/5382/3 "2024-11-06T08:02:19Z")

</div>

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