How to Update Salesforce Account from Jira Custom Field

Screenshot 2022-04-21 at 15.02.54

This article was originally published on the Salesforce Community.

You can integrate Jira and Salesforce using trusted third-party tools. The primary necessity of such integrations is to sync updates to the Jira issue or project with your Salesforce account — preferably automatically. 

Let’s explore a sample use case here. For the purpose of this integration, I have used Exalate.

Custom Field Update: Jira to Salesforce Use Case

A drop-down custom field in Jira allows you to select an account name that is then synced on the Salesforce side as an account entity. Any changes to the account name in Jira will also reflect on the Salesforce side. 

Here are the requirements and challenges:

Primary Requirements

When a user adds a ticket description to the Jira issue, the changes should appear on the Salesforce side without having to copy them manually. 

You need to establish sync rules for the incoming and outgoing data in custom fields. 

You can also set up triggers to automatically update the field on the Salesforce side.

Potential Challenges

  • Accuracy 
  • Network timeouts 
  • Failing triggers
  • Mistakes in rules 

Solution to the Problem: Exalate

Exalate is a two-way integration solution that works with Zendesk, Azure DevOps, ServiceNow, Jira, Salesforce, etc. 

Why Exalate? 

  • You can easily use it to sync Salesforce and Jira custom fields.
  • You can use its Groovy scripting engine for complex use cases.
  • You can save time by syncing existing issues using Bulk Exalate, a feature provided under “Triggers”.

How to Implement Exalate for Data Updates

First, install Exalate on both the Salesforce and Jira sides. Next, follow the instructions in this comprehensive guide to establishing a connection between them.

The connection between Jira and Salesforce must be established using the Script Mode—which allows for the advanced integration that this use case demands. After that, you can start syncing the issue from Jira to SF.

Go to your Jira dashboard and create a new issue.

Note: If you don’t want to manually Exalate the issue, you can add Triggers to automatically sync the issue.

Then, open Exalate in Jira and go to the connection you want to edit. Click on the “Edit connection” icon. 

You have two options: 

  • Outgoing sync (on the Jira side) refers to the data to be sent over to the Salesforce side. 
  • Incoming sync (on the Salesforce side) refers to the data to be received from the issue on Jira.

Under the “Rules” tab, enter the following code snippet into the “Outgoing sync” text area. 

replica.customFields.”SF Account” = issue.customFields.”SF Account”

Note: The issue.customFields function points to the custom field name within the Jira issue. The replica works as a payload or a message. It contains information you want to pass between the two systems. 

Once done, click “Publish” to save the changes.

On the Salesforce side, enter the code in the “Incoming sync” text area.

if(!firstSync){
def response = httpClient.get(“/services/data/v54.0/query/?q=SELECT+id+from+Account+where+name=%27${replica.customFields.’SF Account’.value}%27”)
if(response){
def accId = response.records.Id[0]
httpClient.patch(“/services/data/v54.0/sobjects/Case/${entity.Id}”,
“””
{
“AccountId” : “${accId}”
}”””)
}
}}

We use the httpClient method to fetch (GET and PATCH) the correct account name selected in Jira and save it in a response variable. Then the case in Salesforce is updated with the particular account information. 

Once done, click “Publish” to save the changes.

Now go back to the JIRA issue and change the SF Account to one of the options. 

Back on Salesforce, you will see the Account Name appear automatically.

Congratulations! You have now set rules and triggers to help you update and sync custom Jira fields to Salesforce. 

Subsequently, you can start monitoring things in order to adjust the rules according to the demands of specific projects and issues.

Conclusion

Exalate allows you to update and sync your Jira custom fields with your Salesforce account. You can create specific rules and triggers to tailor the process to the demands of each use case. 

If you still have questions or want to see how Exalate is tailored to your specific use case, book a demo with one of our experts right away.

Comments are closed.