Skip to main content

Examine an Integration Use Case

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe the challenge of keeping incidents in ServiceNow in sync with cases in Salesforce and notifications in Slack.
  • Explain how to use MuleSoft Composer to sync incidents in ServiceNow with cases in Salesforce and notifications in Slack.
  • Prepare to create a flow.

Before You Start

This module builds on MuleSoft Composer Installation and Configuration, so make sure you've completed it before you continue. Recall from that module, you need to have the MuleSoft Composer User permission set if you want to build and run integration flows. 

In this module, we assume you’re an authorized MuleSoft Composer user. If you’re not a MuleSoft Composer user, that’s OK. Read along to learn how they perform the steps. Don’t try to follow the steps in a Trailhead Playground, because MuleSoft Composer isn't available in the Trailhead Playground.

Note

To learn about MuleSoft Composer’s integration features, flow components, and flow creation tasks, take MuleSoft Composer Basics.

In this unit, you step into the role of admin for Northern Trail Outfitters (NTO), an outdoor and recreational gear retailer. First, you examine an integration challenge faced by NTO, and then you learn about a MuleSoft Composer integration solution. Finally, you learn how to prepare to create your flow.

Integration Challenge

Let’s take a look at an integration challenge NTO is facing. Your IT team at NTO uses ServiceNow to manage and maintain incidents reported by customers, partners, and employees. Your customer support team manages and maintains customer service cases in the NTO org’s Service Cloud. To improve service case management and foster team collaboration, both teams need to have immediate visibility into critical customer data about product issues to diagnose and resolve incidents.

Currently, the two teams perform these tasks manually. Every time there’s an incident, the IT team creates or updates the incident in ServiceNow. Then they send an email with relevant incident details to the customer support team. The customer support team, in turn, determines if the incident exists as a case in Service Cloud. 

If a corresponding case doesn’t exist, the team creates a case with relevant incident details in Service Cloud. For cross-referencing purposes, the customer support team also lets the IT team know the Salesforce Case ID associated with the incident. The IT team then updates the incident with the Salesforce Case ID. The customer support team then notifies the service-cases channel in Slack. 

If a corresponding case exists, the customer support team updates it, and then notifies the service-cases channel in Slack. 

This process is time-consuming and highly error-prone, so the teams want to automate it.

Integration Solution

As a solution, you need to automate the integration between ServiceNow, Salesforce, and Slack to achieve near real-time integration. To do this, you use MuleSoft Composer to create an integration flow that automatically syncs the creation or update of incidents in ServiceNow with cases in Salesforce and notifications in Slack. Specifically, the flow must perform the following tasks.

  • Find any new or updated incident in ServiceNow.
  • Determine if a corresponding case exists in Service Cloud.
  • If a corresponding case doesn’t exist:
    • Create a case with relevant incident details in Service Cloud.
    • Update the incident with the Salesforce Case ID in ServiceNow.
    • Notify the service-cases channel about the new case in Slack.
  • If a corresponding case exists:
    • Update the case with relevant incident details in Service Cloud.
    • Notify the service-cases channel about the updated case in Slack.

To implement the solution using MuleSoft Composer, you need to perform these flow creation tasks.

  • Prepare to create a flow.
  • Design and test a flow.
  • Activate a flow.
  • Monitor and troubleshoot a flow.

You learn how to perform these tasks in the rest of this module.

Prepare to Create a Flow

Ready to get started?

First, gather all required information about the systems and assets your flow is going to use. The following table describes the systems the flow needs to connect to and the information you need for those systems.

System Required Information

ServiceNow

  • Instance URL
  • Username and password

NTO’s Service Cloud

  • URLs of the NTO sandbox and production orgs
  • Username and password with appropriate permissions to the NTO orgs

Slack

  • Workspace
  • Channel
  • User ID and password with appropriate permissions

As a best practice, use a test environment for these systems and data when you design and test your flows. After you’re done testing, run the flows using your production systems and data.

Next, you learn about the prerequisites for your ServiceNow, Salesforce, and Slack environments.

Prerequisites for the ServiceNow Environment

First, it’s assumed that you have a ServiceNow instance. Follow these steps to start your ServiceNow instance.

  1. Access the ServiceNow Developer Site.
  2. Click Sign In.
  3. Enter your email address and click Next.
  4. Enter your password and click Sign in.
  5. Click Start Building. ServiceNow launches the instance in a new tab.
    ServiceNow instance tab showing different modules in the Application Navigator.

Next, you must look up the instance URL and the username and password associated with the instance, so you can configure a connection to ServiceNow using MuleSoft Composer later. Follow these steps.

  1. In the first ServiceNow window, click your username icon. Information about the instance is displayed.
  2. Click Manage instance password.
    ServiceNow manage instance password action with login credentials.
  3. Copy the instance URL, username, and password into a text file of your choice. You’ll use these values to configure a ServiceNow connection using MuleSoft Composer later.
    Note: The username you use to configure a ServiceNow connection in MuleSoft Composer is admin. It’s not the username you use to log in to ServiceNow.

If you don’t have a ServiceNow instance, you can sign up for a free, full-featured ServiceNow Personal Developer Instance (PDI). Follow these steps.

  1. Access the ServiceNow Developer Site.
  2. Click Sign up and Start Building.
  3. Enter your first name, last name, email address, and password.
  4. Select ServiceNow’s terms of use check box, and then click Sign Up.
  5. Access the email sent by ServiceNow and then click Verify Email.
  6. Enter your email address and password to sign in to ServiceNow.
  7. In the Getting Started dialog box, click Yes to get a developer-oriented IDE.
  8. Click Next, select ServiceNow’s terms of use check box, and then click Finish Setup. A ServiceNow instance is then set up for you, and the instance details appear.
    ServiceNow instance URL with username and password.
  9. Copy the instance URL, username, and password into a text file of your choice. You’ll use these values to configure a ServiceNow connection, using MuleSoft Composer later.
    Note: ServiceNow also sends you a separate email containing the same instance URL, username, and password.
  10. Click Open Instance. Your ServiceNow instance is displayed.
    ServiceNow instance tab showing different modules in the Application Navigator.

Finally, to capture the Salesforce Case ID for each incident, you must create a text custom field called Salesforce Case ID for the Incidents form by using the Incidents module in ServiceNow. Follow these steps.

  1. In the Application Navigator, click the Incidents module.
  2. Click the out-of-the-box incident INC0010111. The Incidents form is displayed.
  3. Click the hamburger icon next to the incident name, and then select Configure | Form Layout. The Configuring Incident form opens.
  4. Create a new field with the following values.
    • Name: Salesforce Case ID
    • Type: String
    • Field length: Small (40)
  5. Click Add, click Save, and then click Close.
  6. Click the hamburger icon next to the incident name again, and then select Configure | Form Design. The Form Design opens in a new tab.
  7. Drag Salesforce Case ID up to below Watch list, click Save, and then click Close.
  8. Go back to the Incident form tab. You should see the custom field Salesforce Case ID below the Watch list field.
    ServiceNow incident tab showing fields such as number, urgency, and state.

Note: It’s important that your ServiceNow instance be up and running when you design and build flows to integrate using MuleSoft Composer. If it’s not running, start up the instance before designing your flows.

Prerequisites for the Salesforce Environment

It’s assumed that you have a sandbox org and a production org to build and run flows that sync with Salesforce. 

Note: If you don’t have a sandbox org to design and test your flows, you can use a developer org.

Follow these steps to sign up for a free developer org:

  1. Go to https://developer.salesforce.com/signup.
  2. Enter your contact information.
  3. Enter a unique username.
  4. Click Sign me up, and wait for your welcome email.
  5. In the welcome email, click the link to set your password.

To capture the ServiceNow incident ID for the Case object, you must ensure that a text custom field called ServiceNow Incident ID is created for the Case object in the NTO org. Here’s an example of ServiceNow Incident ID for Case in the NTO org.
Case object with ServiceNow Incident ID custom field.

To learn how to create custom fields, see Customize a Salesforce Object.

Finally, when you create a connection to Salesforce using MuleSoft Composer, you’re prompted to grant MuleSoft Composer permissions. Ensure your Salesforce accounts for both your sandbox and production orgs are ready to grant MuleSoft Composer the following permissions.

  • Access the identity URL service.
  • Manage user data via APIs.
  • Perform requests at any time.

Prerequisites for the Slack Environment

To send notifications about leads to a predefined Slack channel, you need a Slack workspace and channel. Follow these steps.

  1. Access slack.com, click LAUNCH SLACK, and then select Create a new workspace.
  2. Enter your email address and click Continue.
  3. Check your email for a confirmation code sent by Slack and enter it in Slack.
  4. Enter NTO as the name of your company, and click Next. NTO is your workspace.
  5. Enter service-cases as the project your team is working on, and click Next; service-cases is your channel.
  6. When prompted to add people, click Skip this step, click Skip Step, and then click Let’s Go to go straight to your workspace and channel.
    Slack NTO workspace with service-cases as a channel.

Finally, when you create a connection to Slack using MuleSoft Composer, you’re prompted to grant MuleSoft Composer permissions. Be ready to grant MuleSoft Composer the following permissions to your Slack workspace.

  • View content and info about channels and conversations.
  • View content and info about your workspace.
  • Perform actions in channels and conversations.

You’ve taken the first steps to prepare to create your flow with MuleSoft Composer. In the next unit, you learn how to design your flow.

Resources 

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities