Skip to main content

Configure ServiceNow manually

Note

Before you continue, make sure you have completed the preliminary steps for installing the update set.

You can choose to manually configure the rest of your ServiceNow integration. This page only provides instructions for setting up the incident webhook endpoints and incident workflows in APEX AIOps Incident Management. For instructions on manually creating the maintenance window catalog and workflow, read Integrate ServiceNow with legacy APEX AIOps Incident Management maintenance windows.

To configure the ServiceNow integration manually:

Configure properties in ServiceNow

  1. From the top menu of ServiceNow, navigate to All > Moogsoft Integration > System > Moogsoft Properties using the search bar.

  2. Within the Moogsoft Properties page, enable editing by clicking the link inside the banner at the top of the page. If you do not see a banner, refresh the page in your web browser.

  3. Fill out any relevant fields. Set the following properties to No to allow for manual configuration of the webhook endpoint:

    • Create the ServiceNow Integration User Account

    • Enable Moogsoft Incident Integration

    For detailed information regarding all the properties on this page, read ServiceNow integration properties reference.

  4. Click Save.

  5. Add a ServiceNow user:

    1. Create an integration user in ServiceNow. The User ID must match the value of the configured Moogsoft Integration ServiceNow User property. The default value for this property is "moogint".

    2. Assign the following roles to the user:

      • x_moogs_incident_m.import: Allows Incident Management to create and resolve incidents.

      • x_moogs_incident_m_properties_user: Allows the ServiceNow user to edit Incident Management properties.

  6. Create a user in Incident Management (optional - only do this step if you have enabled the Moogsoft Assignee Email property in ServiceNow):

    1. Within Incident Management, navigate to Settings > User Management.

    2. Click on the plus (+) button to invite a new user.

    3. Provide a first and last name for the new user.

    4. For the email field, use the email matching the configured value of the Moogsoft Assignee Email property in ServiceNow.

    5. Set the role as "operator" and click Invite.

Configure the CREATE webhook endpoint in Incident Management

Once you have finished configuring the properties in ServiceNow, you must create new incident webhook endpoints in Incident Management in order to pass data bidirectionally. This section explains how to set up the ServiceNowCreate webhook endpoint, which will create new ServiceNow incidents when incidents are processed in Incident Management.

To configure the CREATE webhook endpoint:

  1. Log into Incident Management and navigate to Integrations > Outbound Integrations > Webhook Endpoint > Incident Webhook Endpoint.

  2. Click Add Incident Webhook Endpoint and enter "ServiceNowCreate" as the name of the webhook endpoint. Optionally, provide a description.

  3. Complete each section of the webhook endpoint according to the following:

    1. Triggers:

      1. Skip this section.

    2. Endpoint:

      1. Set the request method as POST.

      2. Under URL, copy and paste the following URL template. Replace <instanceName> with the name of your ServiceNow instance:

        https://<instanceName>.service-now.com/api/now/v1/import/x_moogs_incident_m_moog_inbound_incident

        For example:

        https://dev114226.service-now.com/api/now/v1/import/x_moogs_incident_m_moog_inbound_incident
      3. Under Authorization, select Basic Auth from the dropdown menu.

      4. Click Add New Credentials.

      5. On the Basic Auth Credentials page, enter a unique name. For Username and Password, enter the username and password of the ServiceNow integration user you created earlier.

      6. Click Save to save your new credentials.

      7. Under Headers, make sure the following default header exists:

        Content-Type: application/json
    3. Payload Body:

      1. Copy and paste the following into the Key/Value Editor box, replacing the existing default text:

        {
            "u_inc_id": "$id",
            "u_status":"$status",
            "u_payload": '{"short_description":"$description","assignment_group":"Software","category":"software","subcategory":"os","cmdb_ci":"CMS App FLX","caller_id":"snwdmoog"}',
            "u_affected_cis": '$tags.affected_ci',
            "sysparm_action":"insert",
            "u_snc_id":-1,
            "u_inc_url" : "$incident_url",
            "u_severity": "$severity",
            "u_priority":"$priority_numeric"
        }

        The u_payload section is a JSON string containing the ServiceNow fields you want to populate. You should customize this object for your environment. It needs to be a string, hence the surrounding single quotes.

  4. Save the webhook endpoint.

Configure the UPDATE webhook endpoint in Incident Management

Next, configure a ServiceNowUpdate webhook endpoint, which will update ServiceNow incidents when their corresponding Incident Management incidents are updated.

To configure the UPDATE webhook endpoint:

  1. Navigate to Integrations > Outbound Integrations > Webhook Endpoint > Incident Webhook Endpoint.

  2. At the far right side of the "ServiceNowCreate" webhook endpoint you just configured, click on the copy icon:

    ServiceNowDuplicate.png
  3. Enter "ServiceNowUpdate" for the name of the duplicate webhook endpoint and click Duplicate.

  4. Click on the "ServiceNowUpdate" webhook endpoint to open it.

  5. Make changes to the webhook endpoint in the following sections while leaving everything else the same:

    1. Triggers:

      1. Select the conditions that you would like to trigger the webhook endpoint.

    2. Payload Body:

      1. Copy and paste the following into the Key/Value Editor box, replacing the existing text:

        {
            "u_inc_id": "$id",
            "u_status":"$status",
            "u_payload": '{"short_description":"$description","assignment_group":"Software","category":"software","subcategory":"os","cmdb_ci":"CMS App FLX","caller_id":"snwdmoog"}',
            "u_affected_cis": '$tags.affected_ci',
            "sysparm_action":"update",
            "u_snc_id": "$outbound.ServiceNowMgmt.external_id",
            "u_inc_url" : "$incident_url",
            "u_severity": "$severity",
            "u_priority":"$priority_numeric"
        }

        The u_payload section is a JSON string containing the ServiceNow fields you want to populate. You should customize this object for your environment. It needs to be a string, hence the surrounding single quotes.

        Note

        We use the substitution $outbound.ServiceNowMgmt.external_id for the u_snc_id to reference the External ID we will will configure in the workflow for our CREATE operation.

  6. Save the webhook endpoint.

Configure the CREATE workflow in Incident Management

Configure an incident workflow called Create ServiceNow Incident, which triggers the "ServiceNowCreate" webhook endpoint to create a new ServiceNow incident.

To configure the CREATE workflow:

  1. Log in to Incident Management and navigate to Correlate & Automate > Workflow Engine > Incident Workflows.

  2. Click Add Workflow and enter "Create ServiceNow Incident" as the name of the workflow. Optionally, provide a description.

  3. For the Trigger, select New incidents only.

    If desired, add a filter condition on the incidents that you wish to forward to ServiceNow.

  4. Click Add Action, select the Send to Endpoint action and then click Add Selected Action.

  5. Select the new Send to Endpoint action and complete each section according to the following:

    1. Webhook: Select the "ServiceNowCreate" incident webhook endpoint that you created earlier.

    2. External Link: Check the box.

    3. Integration Name: Enter the following (without quotes): "ServiceNowMgmt"

    4. External ID: Enter the following: result[0].sys_id

    5. External Name: Enter the following: result[0].display_value

    6. URL: Enter the following. Replace <instanceName> with the name of your ServiceNow instance:

      https://<instanceName>.service-now.com/nav_to.do?uri=incident.do?sys_id=${outbound.ServiceNowMgmt.external_id}

      For example:

      https://dev84864.service-now.com.nav_to.do?uri=incident.do?sys_id=${outbound.ServiceNowMgmt.external_id}
  6. Save and Enable the workflow.

Configure the UPDATE workflow in Incident Management

Finally, configure an incident workflow called Update ServiceNow Incident, which triggers the "ServiceNowUpdate" webhook endpoint to forward updates to an existing ServiceNow incident.

To configure the UPDATE workflow:

  1. Navigate to Correlate & Automate > Workflow Engine > Incident Workflows.

  2. Click Add Workflow and enter "Update ServiceNow Incident" as the name of the workflow. Optionally, provide a description.

  3. For the Trigger, select Changed incidents only.

  4. Click Add Action, select the Send to Endpoint action and then click Add Selected Action.

  5. Select the new Send to Endpoint action and complete each section according to the following:

    1. Webhook: Select the "ServiceNowUpdate" incident webhook endpoint that you created earlier.

    2. External Link: Skip this section.

    3. Integration Name: Enter the following: "ServiceNowMgmt"

      Skip all remaining sections.

  6. Save and Enable the workflow.

Test the integration

  1. Navigate to Integrations > Ingestion Services > Events API.

  2. Add your API key to the provided cURL command and run the command in an external terminal to send an event to Incident Management.

  3. Verify that an incident has been created in Incident Management.

  4. Within ServiceNow, verify that an incident has arrived.

  5. If you have enabled updates and included Status changed as a trigger, close the incident in Incident Management and verify in ServiceNow that the incident has been updated accordingly.