This minor version has been deprecated
MuleSoft Accelerator for Salesforce Service Cloud icon

MuleSoft Accelerator for Salesforce Service Cloud

(0 reviews)

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

sfc-sc-create-issue-api-led-architecture.png

Workflow

  1. When a case with ServiceNow or Jira synchronization checkbox selected is created in Service Cloud, it pushes an event to Salesforce PushTopic
  2. Mule streams that event with caseId and pushes it into Anypoint MQ
  3. Mule further consumes that message from Anypoint MQ and retrieves required case details from Service Cloud
  4. Mule transforms the case details from Service Cloud and creates an incident in ServiceNow or issue in Jira

Sequence Diagram

sfc-sc-create-issue-diagram.png

Systems involved

  • Service Cloud, where cases are created
  • Jira
  • ServiceNow (SNOW)

Setup Instructions (Service Cloud → ServiceNow)

ServiceNow (SNOW) 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 NameField LabelData TypeDescription
Sync_With_SNOW__cSync With SNOWCheckbox default uncheckedFlag to Sync Case with ServiceNow
Sync_With_JIRA__cSync With JIRACheckbox default uncheckedFlag to Sync Case with Jira

Summary:

  • Create Custom Fields Sync_With_SNOW__c and Sync_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.

  1. 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.
  2. 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.
  3. Case Process API | API Specification | Implementation Template

  4. 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.
  5. 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.
  6. 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.

  1. Log into Workbench at http://workbench.developerforce.com
  2. Select Data > Insert
  3. Choose PushTopic as the Object Name and Single Record.
  4. Click Next
  5. Populate all required fields as shown below and click Insert
FieldValue
API Version46.0 (Replace with current API version is applicable)
NameAll_Cases (May not contain spaces)
NotifyForOperationCreatetrue
NotifyForOperationDeletefalse
NotifyForOperationUndeletefalse
NotifyForOperationUpdatefalse
QuerySELECT Id FROM Case where Sync_With_SNOW__c = true or Sync_With_JIRA__c = true

Data elements & mapping

ServiceNow

SFDC Data Element NameData TypeDescriptionServiceNow Data Element Name
IdTextCase identifier in salesforce service cloudu_sfdc_case_id
SubjectTextCase subject e.g. “widget received is wrong size”, “router is not responding”short_description
DescriptionTextDetailed description of the casedescription
TypeTextCase type e.g. ”Product Support”, “Account Support”, “General”
StatusTextCase status e.g. “On Hold”, “New”, “Working”, “Escalated”state
PriorityTextCase priority e.g. “High”, “Medium”priority

Priority cross-reference

SalesforceServiceNow
High1 (Critical)
Medium2 (High)
Low3 (Medium)

Jira

SFDC Data ElementNameData TypeDescriptionJira Data Element Name
IdTextCase identifier in salesforce service cloudcustomfield_10027
SubjectTextCase subject e.g. “widget received is wrong size”, “router is not responding”summary
DescriptionTextDetailed description about the casedescription
TypeTextCase type e.g.”Product Support”, “Account Support”, “General”“Bug”
PriorityTextCase priority e.g. “High”, “Medium”priority

Status cross reference

SalesforceServiceNow
New1 (New)
Working2 (In Progress)
Escalated3 (On Hold)
Closed5 (Resolved)

Reviews

TypeCustom
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onOct 30, 2020
Asset overview

Asset versions for 1.3.x

Asset versions
StatusVersionActions
1.3.0