/
How to map a custom Salesforce picklist field to the Affected Services field in Jira.

How to map a custom Salesforce picklist field to the Affected Services field in Jira.

Due to compatibility issues, this feature is not supported out-of-the-box with the Connector. However, with the following Jira Automation workaround, we can map our custom Salesforce field with The Affected Services in JSM.

 Instructions

Part 1: Create a Jira custom field

We’ll need to create a new Jira custom field to capture the value from the Salesforce picklist. This Jira custom field must be added to the create and edit screens of the Issue Type.
(Optional) Add the Jira custom field to the View screen.

  1. In Jira, click Settings > Issues > Custom fields > Create custom field > Select List (single choice) and click next.

  2. In this example, the name of the field is Affected Services Automation, and its options are Demo Service and Demo Service 2. In your case, these values should match the values of your Salesforce picklist.

  3. Once the field is created and added to the needed screens, go to Apps > Salesforce > Bindings > Mapping > mappings and create a mapping between the custom field and the Salesforce picklist.

    image-20240326-191115.png

If the Jira custom field options are the same as the Salesforce picklist, you don’t need to map its values in the mappings. If these values are different, proceed with the value mapping.

Part 2: Creating the Jira Automation

Jira Automation helps to change the value of the affected services every time the value of the affected services automation field changes. Thanks to this automation, when we create a Jira issue from Salesforce, it will have the same Affected Service as the one selected on the Salesforce picklist.

  1. Go to the JSM project > project settings > Automation (on the left side panel) > Create Rule.

  2. In the first component, select the Field value changed option and set it as the image below:

    image-20240103-170010.png

  3. Click Add Component > IF: Add Condition > IF or ELSE: Add condition options > Issue fields condition and set the component as follows:
    Field: Affected Services Automation
    Conditions: equals
    Value: Demo Service

    image-20240103-175753 (1).png

    You should select the first value of the option custom field.

  4. Click on Add component under the if statement > Edit issue > Under Choose field to set, select the Affected Services field, and then select the value that matches the custom field value.

    image-20240103-180042.png
  5. Click on add ELSE > Issue fields condition and set the component as follows:

    image-20240103-180307.png
  6. Click on Add component under the else statement > Edit issue > Under the Choose field to set option, select the Affected Services field, and then select the value that matches the custom field value.

    image-20240103-180335.png
  7. Click Turn on rule > name the rule and click Turn on rule again.

Repeat steps 5 and 6 for each value you need to sync.

Overview of the final automation

image-20240103-180507.png

 

Related content