How to Sync Organization Field Values to a Text Custom Field in Jira Cloud

    This article shows how to sync Organizations field values from Jira Service Desk to a text custom field in Jira Software.

    h2 id="JiraCloud:SyncingOrganizationfieldsvaluestoatextcustomfield-Sourceside">Source Side

    Add the code below to the Outgoing sync

     // ORGANIZATIONS SYNC
    replica.customKeys."Organization Names" = issue.customFields."Organizations".value?.collect { org -> org?.organizationName }?.findAll()
    // END: ORGANIZATIONS SYNC

    Destination Side

    Add the code to the Incoming sync to add the received Organization names into the text custom field. Please replace the custom field name with your custom field name in the code below.

    //add organization names into the "My Text Field"
     issue.customFields."My Text Field".value = replica.customKeys."Organization Names"?.join(",")