MuleSoft Accelerator for Salesforce Service Cloud
Use case 2 - Create issues or incidents
Overview
The following use case is covered:
- Create issues or incidents [Service Cloud -> ServiceNow (a) & Jira (b)]
This use case shows you how to create a new "issue" in Jira or "incident" in ServiceNow from a "case" in Service Cloud.
High-level architecture
Workflow
- When a case with ServiceNow or Jira synchronization checkbox selected is created in Service Cloud, it pushes an event to Salesforce PushTopic
- Mule streams that event with caseId and pushes it into Anypoint MQ
- Mule further consumes that message from Anypoint MQ and retrieves required case details from Service Cloud
- Mule transforms the case details from Service Cloud and creates an incident in ServiceNow or issue in Jira
Sequence diagram
Systems involved
- Service Cloud, where cases are created
- Jira
- ServiceNow
Setup instructions (Service Cloud -> ServiceNow)
ServiceNow configuration
Follow README.md instructions from the common build project asset (look under the configs
folder).
Service Cloud configuration
Create custom fields on the Case object to control incident/issue creation in external systems.
Field Name | Field Label | Data Type | Description |
---|---|---|---|
Sync_With_SNOW__c | Sync With ServiceNow | Checkbox default unchecked | Flag to Sync Case with ServiceNow |
Sync_With_JIRA__c | Sync With Jira | Checkbox default unchecked | Flag to Sync Case with Jira |
Summary:
- Create Custom Fields
Sync_With_SNOW__c
andSync_With_JIRA__c
with "checkbox" as field type. - Create a push topic on the "case" object with the following information in Salesforce:
- API Version 47.0 (replace with current API version if applicable)
- Name All_Cases (may not contain spaces)
NotifyForOperationCreate true
NotifyForOperationDelete false
NotifyForOperationUndelete false
NotifyForOperationUpdate false
- Query:
SELECT Id FROM Case where Sync_With_SNOW__c=true or Sync_With_JIRA__c=true
Mule projects
Follow the README instructions in the following Mule template projects to set up, deploy, and run these projects. All configurable properties can be found in the YAML files in each project.
ServiceNow System API API Specification | Implementation Template
- snow.url: Use this parameter to configure ServiceNow Instance URL.
- snow.urgency: Use this parameter to configure the urgency value of an Incident in ServiceNow.
- snow.severity: Use this parameter to configure the Incident severity level in ServiceNow.
- snow-mapping.priority.**: Use this parameter to configure priority mapping value in ServiceNow.
- snow-mapping.state.**: Use this parameter to configure Incident state mapping in ServiceNow if it is different in the ServiceNow Instance.
Case AMQ Listener | Implementation Template
- sfdc-mapping.state.**: Use this parameter to configure Jira to Salesforce Case Status Mapping used in Jira to Salesforce Update.
- anypoint-mq.**: Use this parameter to configure various properties associated with Anypoint MQ.
Case Process API | API Specification | Implementation Template
Salesforce System API | API Specification | Implementation Template
- sfdc.userName: Use this parameter to configure user login for Salesforce.
- sfdc.caseQuery: Use this parameter to configure the query.
- Salesforce Topic Listener | Implementation Template
- sfdc.username: Use this parameter to configure Salesforce username.
- sfdc.topicName: Use this parameter to configure topic name created in Salesforce.
- sfdc.replyId: Use this parameter to configure reply id. To receive cases from a particular reply id, configure the id. For example, if reply id 10 is configured, all the cases from id 10 will be received again.
- anypoint-mq.**: Use this parameter to configure various properties associated with Anypoint MQ.
- Salesforce Topic Listener | Implementation Template
Jira System API | API Specification | Implementation Template
ServiceNow components & configurations
- A custom field is created in ServiceNow to hold the Salesforce CaseId
- ServiceNow Connector is used to invoke insert operation on incident service
Jira components & configurations
- A custom field is created in Jira to hold the Salesforce CaseId
- API to create Issue in Jira
Service Cloud components & configurations
Click here for documentation on Salesforce push-topics.
Use Workbench to create a push topic query.
- Log into Workbench at http://workbench.developerforce.com
- Select Data > Insert
- Choose PushTopic as the Object Name and Single Record.
- Click Next
- Populate all required fields as shown below and click Insert
Field | Value |
---|---|
API Version | 46.0 (Replace with current API version is applicable) |
Name | All_Cases (May not contain spaces) |
NotifyForOperationCreate | true |
NotifyForOperationDelete | false |
NotifyForOperationUndelete | false |
NotifyForOperationUpdate | false |
Query | SELECT Id FROM Case where Sync_With_SNOW__c = true or Sync_With_JIRA__c = true |
Data elements & mapping
ServiceNow
SFDC Data Element Name | Data Type | Description | ServiceNow Data Element Name |
---|---|---|---|
Id | Text | Case identifier in salesforce service cloud | u_sfdc_case_id |
Subject | Text | Case subject e.g. "widget received is wrong size", "router is not responding" | short_description |
Description | Text | Detailed description of the case | description |
Type | Text | Case type e.g. "Product Support", "Account Support", "General" | |
Status | Text | Case status e.g. "On Hold", "New", "Working", "Escalated" | state |
Priority | Text | Case priority e.g. "High", "Medium" | priority |
Priority cross-reference
Salesforce | ServiceNow |
---|---|
High | 1 (Critical) |
Medium | 2 (High) |
Low | 3 (Medium) |
Jira
SFDC Data ElementName | Data Type | Description | Jira Data Element Name |
---|---|---|---|
Id | Text | Case identifier in salesforce service cloud | customfield_10027 |
Subject | Text | Case subject e.g. "widget received is wrong size", "router is not responding" | summary |
Description | Text | Detailed description about the case | description |
Type | Text | Case type e.g."Product Support", "Account Support", "General" | "Bug" |
Priority | Text | Case priority e.g. "High", "Medium" | priority |
Status cross reference
Salesforce | ServiceNow |
---|---|
New | 1 (New) |
Working | 2 (In Progress) |
Escalated | 3 (On Hold) |
Closed | 5 (Resolved) |