ServiceNow Adapter
The ServiceNow Adapter microservice retrieves events from the Unified Assurance Event database, publishes them to ServiceNow for ticket creation, and keeps the ServiceNow work log and Unified Assurance event journal synchronized.
This microservice is an optional part of the Event microservice pipeline. See Understanding the Event Pipeline in Unified Assurance Concepts for conceptual information.
ServiceNow Adapter Prerequisites
Before deploying the microservice, confirm that the following prerequisites are met:
-
A microservice cluster is set up. See Microservice Cluster Setup.
-
The Apache Pulsar microservice is deployed. See Pulsar.
-
A default-fields.json containing default values to use for ServiceNow tickets has been added in the core/default/processing/event/ticket/snowAdapter SVN directory. The following example shows sample default-fields.json content:
{ "short_description": "$shortDescription", "category": "Network", "assignment_group": "32-char-hex-string-two", "caller_id": "32-char-hex-string-two", "cmdb_ci": "$cmdbCi", "urgency": "$urgency", "impact": "$impact", "work_notes": "$workNotes" }
The ServiceNow API for creating tickets requires these properties in request payloads. The ServiceNow Adapter microservice includes these default values in the payload along with event data.
-
You have created a Kubernetes secret containing the ServiceNow username and password by running the following command as the assure1 user:
a1k create secret generic snow-secret --from-literal=username=<username> --from-literal=password=<password> -n <namespace>
where <namespace> is the namespace where you will deploy the microservice.
Deploying ServiceNow Adapter
To deploy the microservice, run the following commands:
su - assure1
export NAMESPACE=<namespace>
export WEBFQDN=<WebFQDN>
a1helm install <microservice-release-name> assure1/servicenow-adapter -n $NAMESPACE --set global.imageRegistry=$WEBFQDN
In the commands:
-
<namespace> is the namespace where you are deploying the microservice. The default namespace is a1-zone1-pri, but you can change the zone number and, when deploying to a redundant cluster, change pri to sec.
-
<WebFQDN> is the fully-qualified domain name of the primary presentation server for the cluster.
-
<microservice-release-name> is the name to use for the microservice instance. Oracle recommends using the microservice name (servicenow-adapter) unless you are deploying multiple instances of the microservice to the same cluster.
You can also use the Unified Assurance UI to deploy microservices. See Deploying a Microservice by Using the UI for more information.
Changing ServiceNow Adapter Configuration Parameters
When running the install command, you can optionally change default configuration parameter values by including them in the command with additional --set arguments. You can add as many additional --set arguments as you need.
For example, set a parameter described in Default ServiceNow Adapter Configuration by adding --set configData.<parameter_name>=<parameter_value>. For example, --set configData.LOG_LEVEL=DEBUG.
Default ServiceNow Adapter Configuration
Name | Default Value | Possible Values | Notes |
---|---|---|---|
LOG_LEVEL | INFO | FATAL, ERROR, WARN, INFO, DEBUG | The logging level used by the microservice. |
DEFAULT_POLL_TIME | 10 | Integer | The interval at which the microservice synchronizes events between Unified Assurance and ServiceNow, including polling for worklog and incident state updates in ServiceNow. |
PROXY_URL | "" | Text | The proxy URL to use. |
SNOW_SERVER | "" | Text | The URL of your ServiceNow server. |
ServiceNow Adapter Flow
The ServiceNow Adapter microservice sends events to ServiceNow to create tickets and keeps the ServiceNow work log and Unified Assurance event journals up to date as work progresses.
The flow of events between the microservice and ServiceNow is as follows:
-
When a Unified Assurance event's TicketFlag field is set to 1, the ServiceNow Adapter microservice does the following:
-
Creates a journal entry for the event in the Event database with the following details:
-
User: ServiceNow
-
Journal Entry: Open Ticket Request Using ServiceNow Integration
-
-
Sends a POST request with a payload created from the event fields and the default-fields.json properties to the ServiceNow /api/now/table/incident endpoint. The following event fields are included in the ticket's work notes:
-
FirstReported (called First Occurred in the ticket work notes)
-
Node (called Device in the ticket work notes)
-
SubNode
-
EventType
-
Summary
-
Details (called Event Details in the ticket work notes)
-
-
-
The ServiceNow API sends back a response that includes sys_id and ticket_number properties.
-
The ServiceNow Adapter microservice:
-
Adds a new journal entry for the event to indicate that ticket was opened and provide the ticket number and identifier.
-
Updates the TicketFlag field value to 2.
-
Periodically checks the ServiceNow worklog with a GET request at the /sys_journal_field.do endpoint specific to the event.
When new work notes appear in the worklog, the microservice adds new journal entries (starting with ServiceNow Work Note) for them in the Event database.
-
Monitors the event in the Event database for new journal entries.
When entries do not start with ServiceNow Work Note, the microservice sends a PUT request to the ServiceNow /api/now/table/incident endpoint with a payload created from the new work note, with Assure1 Journal added to it.
Because entries that start with ServiceNow Work Note came from ServiceNow, they do not need to be sent.
-
Periodically checks the ServiceNow ticket with a GET request at the /incident.do endpoint specific to the ticket and makes updates as follows:
-
If the ServiceNow incident state and the Unified Assurance Ack state are both 1, the microservice sends a PUT request to the ServiceNow /api/now/table/incident endpoint to update the incident state to 2.
-
If the event severity has been 0 (clear) for five minutes, and the ServiceNow incident state is less than 6, the microservice updates the incident state to 6 and sets close_code to Closed/Resolved By Caller and close_notes to Request from API.
-
When the incident is closed, the microservice adds a corresponding journal entry for the event.
-
-