How to map a custom Salesforce field to the Version field in Jira.

 Problem

Due to compatibility issues, this feature is not supported out-of-the-box with our Connector. However, a custom Salesforce field can be mapped to the Version Jira field using the following Jira Automation workaround.

 Instructions

Part 1: Creating a Jira custom field.

We’ll need to create a new Jira text custom field to capture the value from the SF field. This Jira custom field must be added to the create and edit screen of the Issue Type. It is optional to add it to the View screen.

  1. In Jira, go to settings > Issues > Custom fields > Create custom field > Short Text (plain text only) and click next.

  2. In this example, the name of the field is “Jira_Version

  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 SF picklist.

    image-20240326-211511.png

     

  4. Get the ID of all your versions. You can use the following link to check the version ID on the URL of each version

    https://<yourdomain>.atlassian.net/projects/<Project_Key>?selectedItem=com.atlassian.jira.jira-projects-plugin%3Arelease-page
    image-20240326-212320.png

     

  5. Map the version ID with the version name. With this, you just need to add the version name to the SF field, and the connector will translate the value.

Part 2: Creating the Jira Automation.

Jira Automation will help us change the version value every time the value of the Jira_Version field changes. Thanks to this automation, when we create/update a Jira issue from SF, it will have the same version as the one selected on the SF field.

  1. Go to the 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:

     

  3. Click on “Add Component” > THEN: Add an action > Edit issue > and click on More options.

  4. Copy and paste the following JSON file within the Additional fields box.

    { "update": { "<field_ID>": [ { "set": {"id": "{{fieldChange.toString}}"} } ] } }

     

  5. Click Turn on rule > name the rule and click Turn on rule again.

  • Here is an overview of the final automation