QuerySurge has long emphasized team communication and information-sharing in its design. As part of that emphasis, webhook support was introduced in QuerySurge 10.0. With QuerySurge 11.0 we've added built-in support for ServiceNow Problem creation via webhook.
This article describes the webhook setup for ServiceNow's Problem creation.
Configuring the ServiceNow Webhook in QuerySurge
ServiceNow provides a REST API, and in the following example, we set up a QuerySurge webhook that creates a Problem asset in your ServiceNow instance based on a QuerySurge test run.
1. This is the URL template for the ServiceNow API calls. Note that you'll need your specific ServiceNow instance to complete the URL.
https://<your-instance-name>.service-now.com/api/now/table/problem
2. ServiceNow can use basic authentication to authenticate API requests. A user with access to the ServiceNow instance specified will be able to fire webhooks against that instance:
username=<yourUserName>
password=<yourPassword>
3. The JSON payload in this example is simple to moderate in complexity. The JSON must follow ServiceNow's API syntax rules (consult the ServiceNow API documentation). There are a few items of note here. You can insert QuerySurge values into the message, denoted by the ${...} syntax. If you have required custom fields, you'll need to find out how they are named in the JSON (again, consult the documentation) and configure them with QuerySurge values or hardcoded values as needed.
{
"short_description": "Scenario ${scenarioName} has an outcome of: ${outcome}",
"description": "Percent passing: ${passRate} %\nNumber of QueryPairs: ${numberOfQueryPairs}\n${queryPairsPassed} / ${numberOfQueryPairs} passed\n${queryPairsFailed} / ${numberOfQueryPairs} failed\n${queryPairsKilled}, ${queryPairWarnings}, ${queryPairErrors} killed, warning, errors\n\nRun Owner: ${owner}\nRun Start: ${startTime}\nRun End: ${endTime}",
"assigned_to": "<yourusername>"
}
4. We have created an Event Filter in this example, so that the webhook is only sent (and therefore the ServiceNow Problem is only created) when the Outcome of the execution is 'Not Equal' to 'Passed'. Without setting this filter, we would create a problem in ServiceNow for every QuerySurge execution. The webhook Event Filters are identical to Email Notification Event Filters. For more information, see this article.
Comments
0 comments
Article is closed for comments.