Get client data from Salesforce CRM into JSM requests
The need: Display customers' information coming from a remote CRM
It is common for companies to use a CRM system to manage customer data and interactions.
When customers submit a support request in Jira Service Management, it can be helpful to fill relevant information such as contracts, contacts or accounts. It results in easy tracking and resolution by agents.
To avoid data duplication, manual input errors and ensure that customer data is always up to date, it is important to link the CRM system with Jira. This integration can save time and resources, as it eliminates the need for manual data entry and updates between the two systems.
Integrating a CRM with JSM is an efficient way to manage customer requests while keeping customer data accurate and up to date.
Solution: Use Connected items fetching Salesforce data in JSM
You can either watch the video or follow the step by step tutorial. Please keep in mind that the video only shows Elements Connect configuration. If you need assistance in configuring Salesforce, please read the first configuration step.
Tutorial
Prerequisites:
- Have Salesforce as your Customer Relationship Management tool (CRM)
- Have Elements Connect installed on your instance
Configuration steps:
Configure an app in Salesforce
Configure a data source in Elements Connect
Make sure you have Elements Connect installed on your Jira instance.
→ Go to Elements Connect administration by clicking on “Apps”, then Elements Connect
Create a REST API data source
Click on “Create datasource” and select REST API.
Enter a name for your datasource, then configure the relevant fields:
- Base URL: https://yourcustomurl.my.salesforce.com/
- API Documentation: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm
- Authentication mode:
- Authentication URL: https://login.salesforce.com/services/oauth2/authorize
- Access Token URL: https://login.salesforce.com/services/oauth2/token
- Client ID: {Consumer key} from Salesforce App
- Client Secret: {clientSecret} from Salesforce App
- Scope: full (or any other access you've decided to grant) and refresh_token (not included in any other scope, mandatory to avoid manual refresh of tokens)
- Send in: Request body
If you are using a Salesforce sandbox environment, the Authentication URL and Access Token URL change. Please use the following:
Click on Get access token
You will be prompted to enter your Salesforce credentials and allow the app to communicate with Elements Connect
Once the access token status is valid ( VALID ACCESS TOKEN), you can save your data source.
Configure Connected items in Elements Connect
In this part, we will configure 2 dependent Connected items:
- Accounts: A single select list that fetches every accounts from Salesforce and display their name
- Contact opportunities: A read-only that displays dynamically every opportunities Amount and Name from the previously selected Account
Accounts
Fetch data from API
In the API request, write the following in the endpoint:
- /services/data/v42.0/query?q=SELECT Account.id , Account.name FROM Contact
In the Data in API response, enter the following location:
- records
Customize look & feel
The previous query’s response has the following structure:
As we want to only display the names of Accounts, we configure our freemarker template accordingly:
- ${row.Account.Name}
Contact opportunities
Fetch data from API
In the API request, write the following in the endpoint:
- /services/data/v42.0/query?q=SELECT Opportunity.Id, Opportunity.Name, Opportunity.Amount FROM Opportunity, Opportunity.Account WHERE Account.id = '$issue.connected_item_10024.Account.Id'
$issue.connected_item_10024.Account.Id is to be understood as followed:
For a given issue, it will be replaced by the Account ID of the selected Account (which is the connected item with the ID 10024 in our case)
Customize look & feel
The previous query’s response has the following structure for a given account (number of records can change depending on the account)
We want to display dynamically every opportunities for a given account in a table. As freemarker handles and interpret HTML, you can configure the template as the following:
Associate to a project
You can now associate your newly created Connected items to a project and test them in real life!