Using the functions defined in servicenow.generic.js

Use the alert functions defined in the servicenow.generic.js script to perform customizations on Tivoli Netcool/OMNIbus ObjectServer alerts.

Overview

The servicenow.generic.js script defines functions that are intended to modify processed event data from the gateway before the alert is replicated into ServiceNow. This script is written in JavaScript so JavaScript syntax and notations are to be used.

Imported modules

The servicenow.generic.js file uses the require function to load the following module:

  • Gateway log manager service: Made available through the logger variable.

The updatePayload function

After reading the event data from the object server, the gateway calls the updatePayload function before an event is sent to ServiceNow. This function is intended to allow for the overriding or insertion of values into the event. The implementation provided in servicenow.generic.js provides values for the close_code and close_notes fields when the event Severity equals to 0 (zero).

The addJournal function is defined as follows:

function updatePayload(inserts, operation)
  • inputs -- Specifies a map containing key-pair values of the event data.
  • operation -- Specifies the operation applied to the event, namely: insert, update or delete.