Originally asked by Normann P. Nielsen on 22 December 2022 (original question)
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 - Vendor Status:
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: Service Management]
[Failed to download attachment: attachment_58497935_mail_small.gif. Error: 401 Client Error: for url: Service Management]
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
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:
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:
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.