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

Introduction

Recently we had a request from our customer, who wanted to synchronize 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

Add the code below to the Data Filter 

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

Destination side  

Add the code below to the Create/Change processors

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.