Step 4: Create a Script to Respond to the Event

  • Script Action respond to Events
  • Triggered when an event is recorded in the Event Queue
  • Has access to two object: 1. The current object passed in form gs.eventQueue() 2. The event object

Script can be set to execute whenever a particular activity occurs in the system, rather than at a particular time. Navigate to System Policy > Events > Script Actions to create a new Script Action.

Name - name of the Script Action
Event name - registered even to use for this Script Action
Order - order in which the Script Action executes.
Application - the scope containing the Script Action
Active - selected the check box (true) to enable the Script Action. Note: not selected by default.
Condition script - script the conditions under which the Script Action should execute.
Script - script the logic to execute when the Sctipt Action runs.

The event and current object do not exist in the Condition script field. Testing for condition using these objects must be done in the Script field. Example: if(event.parm1 == 'itil').

TIP FROM THE FIELD
Use this code to see the event object properties.

var output = "";
for (var property in event ) {
output += property + ': ' + event[property]+', ';
}
gs.log("Event Object Properties: " + output);

results matching ""

    No results matching ""