Webhooks for tickets

Overview

Tickets help access and manage certain information and important details. The status or details of the ticket will be updated or modified as per business needs. These updates are confined to the Intelligent Service Management tool, and any update in the ticket will not notify the third-party applications or any associated service. Also, These requests from outside the ISM, mostly about the updates for the existing or new tickets, will bombard the tool resulting in performance issues. To avoid these problems with updates on events being triggered, webhooks are created.

As an administrator or analyst, when you manage certain events in your ISM, you may also want the end-user to get notified about the same. For instance, Whenever a ticket is approved or rejected, you may want to get it notified in the web application and other associated applications to understand what is happening in the ISM. This feature helps automate data exchange between two business applications.

What is a Webhook?

Webhooks are outbound triggers configured to trigger automatically to your web application when certain events occur in ISM, which the user would want to be notified.

The events for which the triggers can be configured are

  • Ticket Created

  • Ticket Updated

  • Attachment Created

  • Attachment Deleted

  • Worklog Created

  • CI Related

  • CI UnRelated

  • Tickets sent for approval.

  • Tickets approved

  • Tickets rejected

  • Tickets NeedMoreInfo

  • Ticket approval overdue

Subscription to any number of the above-listed events or all the events is possible. Users can choose multiple platforms for which the updates are to be triggered, and it is possible to establish a connection between many channels for which these triggered events are to be notified.

Creating and Configuring a New Webhook

To create a new Webhook, follow the below steps:

  1. On the ISM homepage, go to Tools → Webhooks.

     

  2. By clicking on the webhooks tool, you can create a new item or edit an existing item.

  3. Webhooks can be created for various purposes. Consider an example of creating a new webhook for acknowledgments made to a ticket.

  4. Click on New Webhook.

  5. On the General tab, enter a preferred name for the webhook.

  6. The Endpoint URI/Path is the third-party URL for which the updates are to be posted, or the notifications are to be triggered.

  7. Choose the HTTP method like “POST” or “PUT” or “PATCH” as per the information required for the external system.

  8. Select the type of request in the Form Type field. Based on the Ticket type selected for the Form Type field, further details specific to the Ticket type are populated in matching condition.

  9. Select the Entity Type. Select “Ticket” in the entity type as currently, only the “Ticket” entity type is supported.

  10. Under Related Events, You can choose any number of events for which notifications are to be triggered by enabling the checkbox.

  11. Under Matching criteria, choose to match either All or Any condition. An option to define custom conditions is also available if a specific Ticket type is selected. For example, The ticket type selected is Incident then the matching condition will additionally have all custom fields for Incident.

  12. The next section, while setting up a webhook, is the configuration details.

  13. Enter the header details along with the respective information for the Key and Value.

  14. The request body, on the other hand, holds the details to be posted for the external system. The JSON format here can contain any data which is different for distinct web applications.

  15. Click on Save to create the webhook as per your requirement.

  • You can either enable or disable the webhook by toggling the activation button and saving the changes.

  • The search entity type towards the right of the endpoint URI/Path and Request body fields contains all the standard fields and custom fields that can be included in the list of tokens to be sent as part of the API call.

  • A new configuration parameter, “TRIGGER_WEBHOOKS_ON_ISM_EVENTS” is now available that can be used to enable the webhooks feature for receiving the updates regarding tickets to the third-party applications.

Note:

  1. For Attachment created webhook, If filename is required to be sent in the payload, we have a new token which can be used as file_name=${attach_file_name}

  2. For ServiceNow Attachment Endpoints supported earlier were/now/attachment/file and now the supported endpoint is /now/attachment/upload, The later method supports multipart file attachment earlier was supporting binary in the payload.

View Webhook History

Once configured, an active Webhook is automatically triggered when the related events occur in ISM. You can view the historical information of the webhooks triggered from ISM. Follow the below steps to view history:

  1. Select the required Webhook.

  2. Click on the Logs tab. Here you can view the list of events triggered with the following information:

    1. Webhook name represents the name of the Webhook

    2. Case# is the Ticket number for which the event is triggered.

    3. Event Name represents the event triggered for the Webhook. For example, Ticket Creation, Ticket Update, etc.

    4. Entity Name contains the entity for which Webhook is configured.

    5. Executed On is the event execution date

    6. Job Status is the status of the event. It represents if the event was successfully triggered or encountered an error.

    7. Response contains the response received from the target system. In case of a failure, the response holds the error details which can be used in troubleshooting the webhook.

Retrigger an event

You can retrigger an event in the following ways:

From Webhook History

In case an event encounters an error, you can retrigger the failed event from the Webhook History section. To do so,

  1. Select the Webhook and navigate to the Logs tab.

  2. On the events list, select one or more events.

  3. Under Bulk Actions, click on Retry Events.

The selected events are retriggered with the related case details.

Only Failed events can be retriggered with the original case details.

From Ticket Center:

From the Ticket Center, you can retrigger the explicit Webhook events linked to a specific ISM ticket (Attachments, Relating CIs, Worklogs updates, SLA Events). To do so,

  1. Navigate to Ticket Center and select the ticket.

  2. In Actions → Ticket, click on Regenerate Webhook Events. The events for the selected ticket are listed in a popup.

  3. Select the Webhook events to be retriggered and click on retrigger events.

The selected events are retriggered with the ticket details.

© 2019 Serviceaide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com