How to Sync between the Select List (single choice) custom field and issue type

    This article shows how to set an issue type, based on the Select list (single choice) custom field.

    Introduction

    In some cases you may need to synchronize a custom field of type Select list(single choice) to the issue type field on the Destination Instance. Imagine you have a Select List (single choice) custom field called 'Incident Type'. The issue type field on the Destination Instance has only 4 options, which are Feature, Bug, Story, and Task. In case the Incident Type is Feature request you want to set the issue type to Feature. Otherwise, the issue type would be Bug.

    Source side

    Outgoing sync

    replica.customFields."Incident Type" = issue.customFields."Incident Type"
    ...

    Destination side

    Incoming sync

    issue.typeName = replica.customFields."Incident Type".value?.value == "Feature Request" ? "Story" : "Bug"

    Note: The custom field name/options and issue type options are provided only for demonstration purposes. You can easily replace them with your valid data.