Sync Salesforce Cases with ServiceNow Incidents

Sync Salesforce Cases with ServiceNow Incidents

Use this recipe to synchronize Salesforce cases with ServiceNow incidents.

Note: This recipe is available as Salesforce — ServiceNow | Sync Cases and Incidents in the Integration Store. Oracle provides this recipe as a sample only. The recipe is meant only for guidance, and is not warranted to be error-free. No support is provided for this recipe.

Overview

This recipe creates an incident in ServiceNow when a new case is created in Salesforce. Also, whenever a case in Salesforce is updated, the recipe updates the corresponding incident in ServiceNow.

To use the recipe, you must install the recipe package and configure the connections and other resources within the package. When a Salesforce case is created or updated, the integration flow of the recipe is triggered, and it creates or updates the corresponding incident in ServiceNow. Basic data details is synchronized between Salesforce cases and ServiceNow incidents.

System and Access Requirements

Before You Install the Recipe

You must perform the following configuration tasks on your Salesforce and ServiceNow instances in order to successfully connect to these external systems using Oracle Integration and synchronize Salesforce cases with ServiceNow incidents.

Configure Salesforce

To access Salesforce using Oracle Integration and retrieve data about Salesforce cases that are created or updated, you must perform certain configurations on your Salesforce instance.

You must create a user account on Salesforce for Oracle Integration. You’ll use the credentials of this user account while configuring the Salesforce connection in Oracle Integration.

Log in to your Salesforce instance as an Administrator and execute the following tasks.

Note: The steps provided here apply to the Salesforce Classic UI. If you’re using the Lightning Experience UI on your Salesforce instance, switch to the Classic UI.

  1. Create an API-enabled custom role. You’ll assign this role to the user account you’ll subsequently create for Oracle Integration.

    1. On the Salesforce Setup page:

      1. Expand Manage Users under the Administer section in the left navigation pane.

      2. Click Profiles.

    2. On the Profiles page, click New Profile.

    3. On the resulting page:

      1. Select Standard User in the Existing Profile field.

      2. Enter a name for the new profile, for example, API Enabled, and click Save.

      The new profile is now saved, and the Profile Detail page of the new profile is displayed.

    4. Click Edit on the Profile Detail page.

    5. On the Profile Edit page:

      1. Scroll to the Administrative Permissions section and ensure that the API Enabled check box is selected.

      2. Scroll to the Standard Object Permissions section and perform the following actions.

        • In the Accounts row, leave the ReadCreateEdit, and Delete boxes checked. Additionally, select the ViewAll check box.

        • In the Contacts row, leave the ReadCreateEdit, and Delete boxes checked. Additionally, select the ViewAll check box.

        • In the Price Books row, leave the Read box checked. Additionally, select the CreateEdit, and Delete check boxes.

        • In the Products row, leave the Read box checked. Additionally, select the CreateEdit, and Delete check boxes.

      3. Scroll to the end of the page and click Save.

  2. Create a user account for Oracle Integration and assign the custom role created previously to this account.

    Note: If you have already created a user account for Oracle Integration, you can assign the API-enabled custom role to the existing account.

    1. On the Profile Detail page of the API Enabled profile, click View Users.

    2. Click New User in the resulting page.

    3. On the New User page:

      1. Enter a first name and last name for the user, for example, Integration User05.

      2. In the Email field, enter a valid email address.
        The email address you enter is automatically populated in the Username field. Note this username.

      3. In the User License field, select Salesforce.

      4. In the Profile field, select the profile you created previously, that is, API Enabled.

      5. Scroll to the end of the page, ensure that the Generate new password and notify user immediately check box is selected, and click Save.
        The user account is now created, and a verification email is sent to the email address you provided for the account.

    4. Log in to the corresponding email account and click the Verify Account button in the email message from Salesforce.
      You’re redirected to the Salesforce instance to set a password for the new user account.

    5. Set a password and note the same.
      Subsequently, you’re signed in to the Salesforce instance with the new account.

      Note: If you’re shown the Lighting Experience UI, switch to the Salesforce Classic UI.

    6. Generate a security token for the new user account. You’ll need this security token along with the password to access Salesforce using Oracle Integration.

      1. Stay signed in as the new user and click the user name at the top of the page to open a menu.

      2. Click My Settings in the menu.

      3. On the My Settings page, in the Quick Links section, click Edit my personal information.

      4. On the resulting page, click Reset My Security Token in the left navigation pane.

      5. Click the Reset Security Token button.
        A new security token is sent to the email address associated with the account. Note the security token.

      6. On the Salesforce instance, click the user name again and select Logout from the menu. Log back in as the Administrator.

  3. Identify your current Salesforce API version. See Find Your Current Salesforce API Version.

  4. Identify your Salesforce instance type. See Identify Instance Type of Your Salesforce Organization.

  5. Create an outbound message. The outbound message triggers the integration flow of the recipe.

    1. On the Salesforce Setup page:

      1. Scroll to the Build section in the left navigation pane.

      2. Expand Create, then Workflow & Approvals, and then click Outbound Messages.
        If you’re shown the Understanding Workflow page, click Continue.

    2. Click New Outbound Message in the resulting page.

    3. On the New Outbound Message page:

      1. In the Object field, select Case and click Next.

      2. Enter the following details for the new outbound message:

        • Enter a name for the outbound message.
          Note that the Unique Name field is automatically populated based on the name you enter.

        • Optionally, enter a description for the outbound message.

        • In the Endpoint URL field, enter the following URL:
          https://<OIC_FQDN:OIC_SSL_PORT>/ic/ws/integration/v1/flows/salesforce/<RECIPE_IDENTIFIER>/1.0/
          Where OIC_FQDN and OIC_SSL_PORT are the fully-qualified domain name and port of your Oracle Integration instance. For example, oicinstance.example.com:443.
          RECIPE_IDENTIFIER is the identifier for the recipe. For example ORCL-R-SFDC_CASE_TO_SC_IN.

        • Under Case Object, select all the required fields and click Add.

        • Click Save.
          The new outbound message is created and displayed on your browser.

  6. Create a workflow rule to send the outbound message (created previously) when a Salesforce opportunity’s stage is changed.

    1. On the Salesforce Setup page:

      1. Scroll to the Build section in the navigation pane.

      2. Expand Create, then Workflow & Approvals, and then click Outbound Messages.
        If you’re shown the Understanding Workflow page, click Continue.

    2. Click New Outbound Message in the resulting page.

    3. On the New Workflow Rule page:

      1. Select Case in the Object field and click Next.

      2. Enter the following details for the new workflow rule:

        • Enter the rule name.

        • Optionally, enter a description for the rule.

        • In the Evaluation Criteria section, select the created, and every time it’s edited radio button.

        • In the Rule Criteria section, define the following rule criteria:
          Case: Number not equals null

        • Click Save & Next.

      3. On the next page, click the Add Workflow Action button and choose Select Existing Action.

      4. On the Select Existing Actions page:

        • Search for Outbound Message in the Search field.

        • In the Available Actions box, select the outbound message you created previously.
          For example, Outbound Message: <name of the outbound message>.

        • Click Add to move your selection to the Selected Actions box.

        • Click Save.

      5. Click Done.
        The new workflow rule is created and displayed on your browser.

    4. Click Activate to activate the rule.

Configure ServiceNow

To access ServiceNow using Oracle Integration and create corresponding ServiceNow incidents for Salesforce cases that are created or updated, you must perform certain configurations on your ServiceNow instance.

Log in to your ServiceNow instance as an Administrator and execute the following tasks.

  1. Create a custom user (for example, Integration user) and assign a custom role that has access to ServiceNow tables. See Satisfy User and Role Requirements in Prerequisites for Creating a Connection.

  2. Enable web services and assign permissions to required tables.

    1. On the ServiceNow home page, search for tables in the search box in the left pane, and click the Tables link under System Definition in the search results.

    2. Search for each of the following ServiceNow tables using the Search box or locate a table using the show/hide filter.

      • sys_soap_message

      • sys_soap_message_function

      • sys_script

    3. Click the table name in the search results.

    4. Locate and click the Application Access tab.

    5. Select the respective permission (refer to the following table for required permissions), and select the Allow access to this table via web services check box if it is not selected already.

      Table Name Permission
      sys_soap_message Read, Create, Update, Delete
      sys_soap_message_function Read, Create, Update, Delete
      sys_script Read, Create, Update, Delete
  3. Enable multiple insert plugin to support insertMultiple in SOAP.

    1. On the ServiceNow home page, search for System Definition.

    2. Select Plugins.

    3. Locate and click Insert Multiple Web Service.

    4. If the status is inactive, click Activate/Repair.

  4. Get the ServiceNow Caller ID.

    1. On the ServiceNow home page, search for User Administration and then click Users.

    2. On the Users page, select the custom user that you configured earlier in step 1.

    3. Locate the value of the sys_id in the URL that appears when you select the user.

    4. Note the sys_id value as you would need to provide it while configuring lookup table in Oracle Integration.

Install and Configure the Recipe

On your Oracle Integration instance, install the recipe package to deploy and configure the integration and associated resources.

  1. On the Oracle Integration home page, scroll to the Accelerators & Recipes section.

  2. Click Search All.

  3. Find the recipe package that you want to install.

  4. Select the package, and then click the Install Install icon icon.

  5. After the package is installed, click the Configure Configure icon icon on the recipe card to configure the resources deployed by the package.

    The Configuration Editor page opens, displaying all the resources of the recipe package. Configure the following resources before you activate and run the recipe.

Configure the Oracle Salesforce Connection

  1. On the Configuration Editor page, select Oracle Salesforce Connection, then click Edit Edit icon.
    The connection configuration page appears.

  2. In the Connection Properties section, enter the following details.

    Field Information to Enter
    Select Salesforce.com Instance Type Select Production or Sandbox based on your Salesforce instance type.
    API Version Enter your current Salesforce API version. To obtain the API version, see Configure Salesforce.
  3. In the Security section, enter the following details.

    Field Information to Enter
    Security Policy Leave Salesforce Username Password Policy selected.
    Username Enter the username of the account created for Oracle Integration on Salesforce. See Configure Salesforce.
    Password

    Enter the password of the account created for Oracle Integration on Salesforce.

    Note: To the password, you must also append the security token generated for the same account.

  4. Click Save. If prompted, click Save for a second time.

  5. Click Test to ensure that your connection is successfully configured. In the resulting dialog, click Test again.
    A confirmation message is displayed if your test is successful.

  6. Click Back Back icon to return to the Configuration Editor page. Click Save again if prompted.

Configure the Oracle ServiceNow Connection

  1. On the Configuration Editor page, select Oracle ServiceNow Connection.

  2. Click Edit Edit icon.
    The connection configuration page appears.

  3. In the Security section, from the Security Policy drop-down list, select Basic Authentication.

  4. In Username and Password fields, enter the username and password of your ServiceNow instance.

  5. Click Save. If prompted, click Save for a second time.

  6. Click Test to ensure that your connection is successfully configured. In the resulting dialog, click Test again.
    A confirmation message is displayed if your test is successful.

  7. Click Back Back icon to return to the Configuration Editor page. Click Save again if prompted.

Configure the Lookup Table

Edit the lookup table and enter the ServiceNow Caller ID of your ServiceNow instance. After updating the ServiceNow Caller ID, the Salesforce values will be automatically mapped with the ServiceNow values.

  1. On the Configuration Editor page, select the lookup table, and click Edit Edit icon.

  2. Enter the ServiceNow caller ID of your ServiceNow instance in the ServiceNow_Value column, against the ServiceNowCallerID field.
    Note that the ServiceNow Caller ID is the sys_id value that you obtained in step 4 while configuring the ServiceNow instance. See Configure ServiceNow

  3. Click Save. If prompted, click Save for a second time.

  4. Click Back Back icon to return to the Configuration Editor page.

Activate and Run the Recipe

After you’ve configured the connections and the lookup table, activate the recipe package and run it.

  1. On the Configuration Editor page, click Activate in the title bar. In the Activate Package dialog, click Activate again.
    A confirmation message is displayed informing that the integration has been submitted for activation. Refresh the page to view the updated status of the integration.

  2. Run the recipe to update the Salesforce outbound message with the real endpoint URL.

    1. On the Configuration Editor page, select the integration flow.

    2. Click Run Run icon and then click Metadata URL in the resulting dialog.

    3. Copy and note the endpoint URL. You’ll use this endpoint URL in the step below.

    4. Log in to Salesforce as an administrator, and update the endpoint URL:

      1. On the Salesforce Setup page, click the Home tab.

      2. In the Quick Find seach box on the left, search for Outbound Messages.

      3. Under Workflow Actions, click Outbound Messages.

      4. From the list of entries, click the outbound message to update.

      5. In the Outbound Message details page, click Edit.

      6. In the Endpoint URL field, delete the existing entry and paste the endpoint URL obtained from Oracle Integration.

      7. Click Save.

  3. Test the recipe.

    1. Log in to our Salesforce instance and create a new case.

      1. Click the Cases tab.

      2. In the Cases page, click New.

      3. Enter the required details.

      4. Click Save.

    2. Monitor the execution of the integration flow in Oracle Integration.

      1. On the Configuration Editor page, select the integration flow.

      2. Click Run Run icon, then click Track Instances.

      3. On the Track Instances page, you’ll see the integration flow of the recipe being triggered and executing successfully.
        The recipe now creates a corresponding incident in ServiceNow for the new Salesforce case.

      4. Note the Salesforce case number from the Track Instances page. You can use the case number to search for the corresponding incident that was created in ServiceNow.

    3. Log in to your ServiceNow instance and check for the new incident created.

      1. Navigate to the Incidents page.

      2. To find the the newly created ServiceNow incident, filter with the case number of the new Salesforce case. Enter the Salesforce case number in the field under the Number column.
        The new ServiceNow incident is listed on the Incidents page.

Related Documentation