Skip to main content

Enable bidirectional comments between Moogsoft Cloud and ServiceNow

Bidirectional comments make it possible to synchronize the comments between ServiceNow and Moogsoft Cloud. The following procedures explain how to configure bidirectional comments.

Important

Before starting setting up bidirectional comments support, you must first complete the steps for manual configuration using incident workflows and webhook endpoints.

After setting up communication between ServiceNow and Moogsoft, you must complete two procedures (included below) to enable bidirectional comments:

  • Configure a new incident webhook endpoint in Moogsoft

  • Configure an incident workflow in Moogsoft

Configure a new incident webhook endpoint in Moogsoft

Begin by creating a new incident webhook endpoint called ServiceNowComments which forwards comments as work_notes to ServiceNow.

  1. Log in to Moogsoft and navigate to Integrations > Outbound Integrations > Webhook Endpoint > Incident Webhook Endpoint.

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

    ClickCopyIconInServiceNow.png
  3. Enter "ServiceNowComments" as the name of the webhook endpoint and then click Duplicate.

  4. Click the "ServiceNowComments" webhook endpoint to open it for editing.

  5. Make the changes to the webhook endpoint as indicated while leaving the other settings as they are:

    • Triggers

      Enable the Comments updated trigger.

    • Payload Body

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

      {
          "u_inc_id": "${id}",
          "u_payload": '{"work_notes":"${last_comment.created_by}: ${last_comment.comment}"}',
          "sysparm_action":"update",
          "u_snc_id": "${outbound.ServiceNowMgmt.external_id}"
      }

      In this payload, the email address of the user that added the comment is prefixed to the work_note in ServiceNow. This can be customized as required.

Configure an incident workflow in Moogsoft

Next, add a new incident workflow called "Add comments to ServiceNow" to trigger the new webhook endpoint.

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

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

  3. For the Trigger, select Changed incidents only.

  4. In the Filter, add a new filter condition:

    changes in (comments) AND originator != <external_user_email>

    This filter accomplishes two things:

    • changes in (comments) causes the workflow to trigger only when updates are made to comments

    • originator != <external_user_email> is required for loop prevention. The <external_user_email> is the email address associated with the Moogsoft API key configured in ServiceNow.

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

  6. Select the new Send to Endpoint action and edit the three sections indicated. Skip the other sections.

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

    2. External Link: Skip this section.

    3. Integration Name: "ServiceNowMgmt"

  7. Save and Enable the workflow.