This component is a simple notifier adapter which can be used together with the Iguana X notification system to create incident tickets in ServiceNow using the ServiceNow Table API.
This component can be adapted according to your requirementsNeed help? Contact us:
...
The ServiceNow adapter is designed to provide a template for getting started with ServiceNow API integrations. It leverages the SERVICENOW Library to:
Authenticate with the ServiceNow API via OAuth2.0 (JWT).
Create and retrieve Incident table records in ServiceNow.
This component can be customized and adapted according to your workflow needs. For example, it could be adapted as a Notifications component that integrates Iguana notifications with an existing support workflow. The ServiceNow Rest API Explorer is useful for reviewing the available API endpoints.
Component Setup:
Expand | ||
---|---|---|
| ||
Refer to Set up a ServiceNow Developer Sandbox for the ServiceNow sign up and application set up required in order to gather the authentication details needed for the ServiceNow NotifierAdapter. |
Expand | ||
---|---|---|
| ||
See Create a Component if this is your first time! |
Expand | ||
---|---|---|
| ||
Expand | ||
| ||
Using the information provided, the ServiceNow component will run through the authentication workflow and set the Key and KeyExpiry value of the obtained access token automatically. These values do not need to be configured manually. |
Expand | ||
---|---|---|
| ||
In the Translator, update the caller ID in the createTbRecord function so any newly created tickets will be associated with the appropriate user. In ServiceNow, this caller ID will be the sys_id of the user you wish to associate with the tickets. This can be retrieved by going to Organizations > Users, searching for your user, and right-clicking the User ID to choose the option to copy the sys_id (will be a long character string). |
Expand | ||
---|---|---|
| ||
In Settings > Notifications, click EDIT and select the ServiceNow Notifier to be invoked by notification rules. Click Save. |
Expand | ||
---|---|---|
| ||
|
Component Workflow:
Expand | ||
---|---|---|
| ||
The following reviews how this component creates ServiceNow incident ticket using alert information from Iguana’s notification system:
Continue below for an overview on how the SERVICENOW Library orchestrates this workflow. |
The SERVICENOW Library:
Expand | ||
---|---|---|
| ||
Sets up the ServiceNow Notifier framework, adding the method modules to a metatable and storing the configurations from the custom fields in a table to call the API. |
Expand | ||
---|---|---|
| ||
The SERVICENOWauth function, builds and makes the HTTP POST token request to obtain the access token required for any resource requests against the FHIR Server. A separate CreateJWT function creates the JSON Header and Payload components of the JWT and calls the OAUTH Library to sign and return the JWT required for the token request. If the token requests is successful (HTTP 200 response), the token and token expiry returned are set to the Key and KeyExpiry custom fields respectively. |
Expand | ||
---|---|---|
| ||
SERVICENOWcustom takes in any API requests and parameters to make the API call and return the response.
|
SERVICENOWcreateTbRecord prepares the arguments and calls SERVICENOWcustom to create an incident ticket in ServiceNow via HTTP POST request.store the returned access token and expiry time in an encrypted file for use on subsequent API requests. |
Expand | ||
---|---|---|
| ||
|