ServiceNow Destination (Custom Webhook)
Set up ServiceNow alerts using Panther's custom webhook option
Overview
How to configure ServiceNow to create tickets from Panther alerts
Prerequisites
Step 1: Create a Scripted REST API in ServiceNow
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { // prep the different fields var data = request.body.data; var title = data.title; var alert = JSON.stringify(data); var alertContext = JSON.stringify(data.alertContext); var severity = data.severity; var link = data.link; var runbook = data.runbook; var type = data.type; var alertId = data.alertId; var grIncident = new GlideRecord('incident'); grIncident.initialize(); grIncident.setValue('short_description', title); grIncident.setValue('description', alert ); grIncident.setValue('category', type); grIncident.setValue('subcategory', alertId); //Map urgency to Panther severity if (severity == "CRITICAL" || severity == "HIGH") { grIncident.setValue('urgency','1'); grIncident.setValue('impact','1'); } else if (severity == "LOW" || severity == "MEDIUM") { grIncident.setValue('urgency','2'); } else { grIncident.setValue('urgency','3'); } //grIncident.insert(); var recResponse = grIncident.insert(handleResponse); function handleResponse(recResponse, answer) { // Answer will be the sys_id of the created record or null alert('Newly created sys_id is - ' + answer + ' exists'); } var url = gs.getProperty('glide.servlet.uri'); //building the response of the API, this example returns the incident ID that got created above. var body = {}; body.sys_id = recResponse; body.link = url + "task.do?sys_id=" + recResponse; response.setBody(body); //example test event from Panther when creating and testing destination integration //{"id":"Test.Alert","createdAt":"2022-04-26T03:17:32.099054303Z","severity":"INFO","type":"RULE","link":"https://domain.runpanther.net","title":"This is a Test Alert","name":"Test Alert","alertId":"Test.Alert","alertContext":{},"description":"This is a Test Alert","runbook":"Stuck? Check out our docs: https://docs.runpanther.io","tags":["test"],"version":"abcdefg"} })(request, response);
Step 2: Create a Custom Webhook integration in Panther
Example

Last updated
Was this helpful?








