ServiceNow Incident Integration
ServiceNow is a popular IT services management platform. You can create Operations for Applications alert targets that surface alerts as ServiceNow incidents of different priorities (High, Moderate, Low, Planning). Incidents can also optionally be assigned to groups or categorized.
ServiceNow Setup
Step 1. Create an Operations for Applications alert user in ServiceNow
Operations for Applications will use the ServiceNow user to create incidents. The user will be identified as the caller for each incident. This user will be used by Operations for Applications to create incidents in ServiceNow and will also be identified as the Caller for each incident.
- In ServiceNow, navigate to System Security > Users & Groups > Users and click New.
- Specify a User ID (for example
appMonitor
) and a First Name (for exampleOperations for Applications Alerts
). - Make sure that you leave the Password needs reset check box deselected.
- Select the Internal Integration User check box.
- Click Submit. The new user is created.
Step 2. Generate password for the Operations for Applications alert user
- In ServiceNow, navigate to System Security > Users & Groups > Users.
- Search for the user created in Step 1 and click the user.
- On the user page, click Set Password.
- In the Set Password window, click the Generate button.
- Click Copy to copy the password.
- Click the Save Password button and close the Set Password window.
Step 3. Copy and save the new user’s sys_id
Copy and save the user’s sys_id so you can make the user the caller for incidents that are created.
- In ServiceNow, navigate to System Security > Users & Groups > Users.
- Search for the user created in Step 1.
- Right-click the User ID and select Copy sys_id.
- Paste the sys_id into a text file or scratch pad.
Step 4. Generate and save a basic authorization string
The ServiceNow API uses Basic Authorization, a Base64 encoded string, for the user and password. You will use this string in the Authorization header for the API call that creates incidents in ServiceNow. There are several ways to generate this string, this guide uses a public website.
- Navigate to https://www.base64encode.org.
- Type in the user and password created in Step 1 in this format:
user:password
. - Click the Encode button.
- Copy the resulting Base64 encoded string.
- Paste the Base64 encoded string into a text file or scratch pad to save it for later.
Step 5. Create a ServiceNow Alert Target
- In Operations for Applications, create an Alert Target.
- Give the Alert Target a meaningful name and description.
- As Triggers, select the Alert Firing, Alert Status Updated, and Alert Has No Data options.
- Set Type to Webhook.
- Set the URL field to
https://YOUR_INSTANCE.service-now.com/api/now/table/incident
replacing YOUR_INSTANCE with the name of your instance in ServiceNow. - Set Content Type to application/json.
- Create a new Custom Header with the name
Authorization
and the valueBasic <TOKEN>
, whereis the Base64 token that you copied and saved in Step 3. - Copy and paste the following into the Body Template of the alert target.
{{! https://docs.wavefront.com/alert_target_customizing.html }} { "short_description":"{{#jsonEscape}}{{{name}}}{{/jsonEscape}}", "description":"Series: {{#trimTrailingComma}}{{#jsonEscape}}{{#newlyFailingSeries}}{{{.}}}, {{/newlyFailingSeries}}{{/jsonEscape}}{{/trimTrailingComma}}\nSources: {{#trimTrailingComma}}{{#jsonEscape}}{{#newlyFailingHosts}}{{{.}}}, {{/newlyFailingHosts}}{{/jsonEscape}}{{/trimTrailingComma}}\n\n{{{url}}}\n\n{{#jsonEscape}}{{{additionalInformation}}}{{/jsonEscape}}", "state":"1", "impact":"{{#severityInfo}}3{{/severityInfo}}{{#severitySmoke}}3{{/severitySmoke}}{{#severityWarn}}2{{/severityWarn}}{{#severitySevere}}2{{/severitySevere}}", "urgency":"{{#severityInfo}}3{{/severityInfo}}{{#severitySmoke}}2{{/severitySmoke}}{{#severityWarn}}2{{/severityWarn}}{{#severitySevere}}1{{/severitySevere}}", {{! caller_id is the reference to any Security User in ServiceNow that will be used as the Caller for the incident record }} "caller_id":"", {{! The following parameters are popular optional fields used in ServiceNow }} {{! assignment_group is the reference to any Security group in ServiceNow }} "assignment_group":"", {{! category is any valid cateogry string that can be used for incidents }} "category":"" }
Note: The
assignment_group
andcategory
parameters are optional in the template. - In the Body Template, find the
caller_id
property and set its value to thesys_id
that you copied in Step 2. -
Customize other aspects of the template as desired.
- Click Save
Step 6. Add the ServiceNow alert target to an Operations for Applications alert
- In Operations for Applications, open the Alerts browser.
- If you have an alert, locate the alert and click the alert name to open the alert in edit mode. Otherwise, create an alert. For help, see Create and Manage Alerts.
-
Scroll down to the Recipients field.
- Enter the alert target ID into the Alert Target field and select the alert target from the drop-down list to add the list of targets.
- Click Save.