ServiceNow
To create Incidents in ServiceNow for Squadcast Incidents with the help of Outgoing Webhooks
Last updated
To create Incidents in ServiceNow for Squadcast Incidents with the help of Outgoing Webhooks
Last updated
You need to generate a basic token using their API Key to authenticate ServiceNow APIs. Use a tool to generate a basic token out of the API Key.
Here we have used Postman to generate the basic token
Open a new tab in Postman
Paste the below curl in the URL space
Navigate to Authorization -> Type Basic Auth -> In the Username field paste the API Key copied from the profile page.
Navigate to Headers -> Key Authorization -> Copy the Value
To know more about ServiceNow Authentication and generating API keys. Check here.
curl -v -u apikey:X -H "Content-Type: application/json" -X GET 'https://instance.service-now.com/api/now/table/incident'
Note:
Replace the word “instance” in the URL with your Instance Name
Follow the below steps to configure the “ServiceNow - Create Incident” action via Webhooks:
Navigate to Settings -> Webhooks.
Click Add Webhook. On the next screen, you will be guided through three steps. Navigate between these steps by clicking on any of the steps on the top bar.
Add Webhook Details:
Webhook Name: Enter the webhook name as ServiceNow - Create Incident.
Webhook Description (optional): Enter an optional description. For example - This webhook is for incident creation in ServiceNow for Squadcast Incidents.
Failure Notification Email (optional): Enter an email where you want to receive failure notifications. This is particularly helpful when you (or an administrator) want to be notified of webhook-related failures.
URL: Enter the Webhook URL copied from ServiceNow.
Additional Headers: Add Key: Authorization
and paste the Value
copied from Postman
To copy Webhook URL from ServiceNow:
1) Log in to your ServiceNow Instance (dev*****133.service-now.com)
2) Search for the Rest API Explorer and open it
3) In the Rest API Explorer page choose the Namespace and API Name with the proper API version.
Note:
Make sure you have selected the POST request.
Content-Type: application/JSON is added by default under Headers
Click Next: Choose Webhook Type, and navigate to the next step.
Choose Webhook Type: Choose Webhook type (Manual or Automatic) and add configurations.
Manual Webhook: Manually trigger Webhooks under incidents, on demand. Under Manual Webhook, select the teams that are authorized to access the Webhook. You can select All Teams or enter specific Teams, from the drop-down.
Note:
Select this option only if you want to create ServiceNow incidents manually on-demand. If you want a ticket, created automatically when certain conditions are met, please choose Automatic webhooks.
Automatic Webhook: Automatically trigger Webhooks when the configured conditions match. To set up Automatic Webhook Configurations:
Versions: Select v2
Triggers: Select the following Trigger events (conditions) for which the Webhook will be triggered:
Incident Triggered (This will create a ServiceNow incident whenever a new incident gets triggered in Squadcast)
Filters: You can apply filters on top of events, based on Teams, Services, Alert Sources, and Tags, by having an individual expression or a combination of expressions/expression groups.
Applying filters will trigger the webhook and create ServiceNow incidents only for events that match the filter. Check the example config below:
Click Next: Configure Payload, and navigate to the next step.
Configure Payload: Select the pre-configured template for ServiceNow - Create Incident. You can also test the Webhook by clicking the Test Webhook on the bottom right.
Note:
We have added the necessary fields in the template. You can change the Keys that are mandatory according to your use case and can add additional ticket fields.
Click Save and your Webhook is created.