How to Sync Picklist and Picklist Multi-Select Fields in Exalate for Salesforce

    This article describes how to sync Picklist and Picklist Multi-select object fields.

    Picklist sync

    In this example, we are going to sync the Picklist Priority field from Salesforce Case to Jira.

    Salesforce Outgoing sync rules
    replica.priority = entity.Priority

    Jira Incoming sync rules:

    issue.customFields."Hobby".value = replica.priority?.value ?: "Running"  
    //Running will be set as a default option if Priority has no selected option

    Jira Outgoing sync rules
    replica.customFields."text" = issue.customFields."text"

    Salesforce Incoming sync rules:

    entity.SuppliedCompany = replica.customFields."text".value


    Picklist Multi-select sync

    In this example, we are going to sync the Picklist Multi-select field from Salesforce Case to Jira.

    Salesforce to Jira sync

    Salesforce Outgoing sync rules:

     replica.custom_multi_picklist__c = entity.custom_multi_picklist__c

    Jira Incoming sync rules:

    issue.customFields."Hobby".value = replica.custom_multi_picklist__c?.value ?: "Running"
    //Running will be set as a default option if custom_multi_picklist__c has no selected options

    Another example of Jira Incoming sync rules that also includes nodeHelper getOption

    issue.customFields."Hobby".value = replica.custom_multi_picklist__c.collect{c -> nodeHelper.getOption(issue, "Running", c.value)}

    Jira to Salesforce sync

    Jira Outgoing sync rules:

    replica.customFields."Hobby" = issue.customFields."Hobby"

    Salesforce Incoming sync rules:

    entity.custom_multi_picklist__c = String.join(";", replica.customFields."Hobby".value.collect{o -> o.value }))

    Have more questions? Ask the community