How to sync custom field from ZenDesk to JIRA

Originally asked by Gautam Dama on 24 August 2021 (original question)


I am trying to sync severity from Zendesk to JIRA. Severity is a custom field on both sides and the options are also same(Low, Medium, High, Blocker). I have tried the following

issue.customFields.“Severity”.value = replica.customFields.“Severity”?.value?.value

issue.customFields.“Severity”.value = replica.customFields.“Severity”.value.value

issue.customFields.“Severity”.value = replica.customFields.“Severity”.value

def remoteSeverity = replica.customFields.“Severity”?.value?.value
issue.customFields.“Severity”.value = severityMap[remoteSeverity] ?: remoteSeverity
issue.customFields.“Severity” = remoteSeverity.value

Keep getting the same error

Jira Cloud error
Field Specify a valid value for Severity: customfield_10108.


Answer by Ariel Aguilar on 24 August 2021

Hi Gautam,

We have seen Zendesk values are stored in lower case. Maybe you can try to do:

Outgoing Zendesk:

replica.customFields."Severity" =  issue.customFields."Severity"

Incoming Jira:

def severityMap = [
"low": "Low", 
"medium": "Medium",
"high" : "High",
"blocker" : "Blocker"
] // ["remote options" : "local option"]
def remoteValue = replica.customFields."Severity".value 
issue.customFields."Severity".value = severityMap[remoteValue] ?: remoteValue

Kind regards,

Ariel


Comments:

Gautam Dama commented on 24 August 2021

Thanks Ariel, that did the trick!!

Ariel Aguilar commented on 24 August 2021

You’re welcome!

Ariel