Originally asked by Sandra Campbell on 10 June 2022 (original question)
How do I sync Organization in Zendesk to a list field in Jira - and specify a default if the value is not found?
Sync works (with help from : Sync organization from Zendesk to Jira) if the value sent from Zendesk does exist in the Jira single select list field:
Zendesk outgoing sync
def orgId = issue.organization_id
if(orgId){
def orgName = httpClient.get("/api/v2/organizations/"+(long)orgId+".json").organization.name
replica.customKeys."Organization" = orgName
}
Jira incoming sync
issue.customFields."OEMs".value = replica.customKeys.Organization
Tried setting the default to “Others” like this but it did not work:
Jira incoming sync
issue.customFields."OEMs".value = replica.customKeys.Organization ?: "Others"
thanks,
Sandra