ServiceNow: Event

Disclaimer

Your use of this download is governed by Stonebranch’s Terms of Use.

Version Information

Template Name

Extension Name

Extension Version

Template Name

Extension Name

Extension Version

ServiceNow Event

ue-servicenow-event

1.1.0

Refer to Changelog for version history information.

Overview

ServiceNow is a cloud-based platform that provides a suite of IT service management (ITSM) and business process automation (BPA) tools. It is designed to help organizations streamline and automate various processes, improving efficiency and collaboration across different departments. ServiceNow Events refer to the event management functionality within the broader ServiceNow platform. This feature is designed to help organizations detect, analyze, and respond to various events in real-time.

This integration provides the capability to generate (register) an Event in ServiceNow Platform.

Key Features

Feature

Description

Feature

Description

Event Registration

Capability to register an event on ServiceNow Platform with various authentication methods

Software Requirements

This integration requires a Universal Agent and a Python runtime to execute the Universal Task.

Area

Details

Area

Details

Python Version

Requires Python 3.7 or python 3.11

Universal Agent

Both Windows and Linux agents are supported:

  • Universal Agent for Windows x64 >= 7.3.0.0.

  • Universal Agent for Linux Version >= 7.3.0.0.

Universal Controller

Universal Controller Version >= 7.3.0.0.

Network and Connectivity

Connection towards ServiceNow Endpoints is required

ServiceNow Platform

Tested against Vancouver release. Should be compatible also with future releases if API backward compatibility is preserved

Supported Actions

Action: Create Event

Through this action is it possible to Create (Register) an Event on ServiceNow Platform passing mandatory and optional fields.

Configuration examples

Create an event with common fields

 

event_example1.png

Send an Event with some Common Fields using Basic Authentication. “Time of Event” is empty, therefore the local time of Agent will be used as event timestamp. Detailed event information is printed on Extension Output.

 

event_example2.png

Send an Event with some Common Fields using OAuth2 Authentication.

 

Send an Event with some Common Fields using Basic Authentication. “Time of Event” is empty, therefore the local time of Agent will be used as event timestamp. Detailed event information is printed on Extension Output.

 

Send an Event with some Common Fields using OAuth2 Authentication.

Create an event with common and additional fields

If a ServiceNow Field is defined in Additional Fields (JSON), and at the same time it is defined with a value on another existing field, the value defined on the specific designated field has precedence and the one defined on Additional Fields (JSON) will be ignored.

 

Send an Event with some Common and Additional Fields using Basic Authentication. “Time of Event” is empty, therefore the local time of Agent will be used as event timestamp.

 

Send an Event with some Common and Additional Fields using OAuth2 Authentication.

 

Send an Event with some Common and Additional Fields using Basic Authentication. “Time of Event” is empty, therefore the local time of Agent will be used as event timestamp.

 

Send an Event with some Common and Additional Fields using OAuth2 Authentication.

Action Output

Output Type

Description

Example

Output Type

Description

Example

EXTENSION

The extension output provides the following information:

  • “exit_code“, “status“ , “status_description“: General info regarding the task execution. For more information users can refer to the exit code table.

  • “invocation” > “fields”: The task configuration used for this task execution.

  • “result” > “event_info“: Detailed information on registered event is printed as returned by ServiceNow EndPoints. Visbility of information might differ based on ServiceNow Platform configuration and version.

  • “result” > “errors“: List of errors that might have occurred during execution.

{ "exit_code": 0, "status": "SUCCESS", "status_description": "Task executed successfully.", "invocation": { "extension": "ue-servicenow-event", "version": "1.0.0", "fields": {...} }, "result": { "event_info": { "resolution_state": "Closing", "processing_sn_node": "", "description": "my_description", "source": "my_source2", "sys_updated_on": "2023-09-25 23:06:38", "type": "my_event_type", "ci_identifier": "", "sys_id": "192e633097e1711048dbf5b0f053afa8", "sys_updated_by": "admin", "ci_type": "", "metric_name": "my_metric_name", "alert": "", "processing_notes": "", "sys_created_on": "2023-09-25 23:06:38", "sys_domain": { "link": "https://dev106436.service-now.com/api/now/table/sys_user_group/global", "value": "global" }, "state": "Ready", "message_key": "this is a message key", "sys_created_by": "admin", "time_of_event": "2023-09-26 22:47:23", "severity": "2", "error_msg": "", "cmdb_ci": "", "resource": "my_resource", "sys_mod_count": "0", "event_rule": "", "classification": "0", "sys_tags": "", "bucket": "87", "node": "my_node", "processed": "", "additional_info": "{param1=value1, param2=value2}", "processing_duration": "", "event_class": "my_event_class" } } }
{ "exit_code": 1, "status": "FAIL", "status_description": "<mesage description>", "invocation": { "extension": "ue-servicenow-event", "version": "1.0.0", "fields": { ... }, }, "result": { "errors": [ "Data Validation Error: Invalid date 2024-10-10 10, must be in YYYY-MM-DD [HH:MM:SS] format" ], } }

 

STDOUT

Empty

Empty

STDERR

General logging information about the state and execution of the extension

 

 

Input Fields

Field

Type

Description

Introduced in Version

Field

Type

Description

Introduced in Version

Action

Choice

The action performed upon the task execution.

1.0.0

Instance URL

Text

ServiceNow URL e.g. https://dev532313.service-now.com

1.0.0

Authentication Type

Choice

The Authentication Type used:

  • Basic Authentication – (Default)

  • Oauth2 (ServiceNow API endpoint)

  • Certificate Based Authentication

“Certificate Based Authentication” is not for public use. Please contact support if you are interested in using this option

1.0.0

ServiceNow Credentials

Credentials

Credentials for "Basic" Authentication Type. The Credentials definition should be as follows.

  • User as "Runtime User".

  • User Password as "Runtime Password".

Required then Authentication Type is “Basic” or “Oauth2 (ServiceNow API endpoint)”

1.0.0

Client Credentials

Credentials

Client Credentials. The Credentials Definition should be as follows:

  • Client ID as "Runtime User".

  • Client Secret as "Runtime Password"

Required then Authentication Type is “Oauth2 (ServiceNow API endpoint)”

1.0.0

Client Certificate Path

Text

Full Path of the public key certificate for SSL client-side authentication. The file must be in PEM format. Required when Authentication Type is set to “Certificate Based Authentication”

1.0.0

Client Private Key Path

Text

Full Path of the private key file for SSL client-side authentication. The file must be in PEM format and not encrypted. Required when Authentication Type is set to “Certificate Based Authentication”

1.0.0

Source

Text

The name of the event source type. For example, “SCOM” or “SolarWinds”.

1.0.0

Event Class

Text

Specific instance of the source. For example, “SCOM 2012 on 10.20.30.40”

1.0.0

Node

Text

The Node field should contain an identifier for the Host (Server/Switch/Router/etc.) that the event was triggered for. The value of the Node field can be one of the following identifiers of the Host:

  • Name

  • FQDN

  • IP

  • Mac Address

If it exists in the CMDB, this value is also used to bind the event to the corresponding ServiceNow CI.

1.0.0

Resource

Text

If the event refers to a device, such as, Disk, CPU, or Network Adapter, or to an application or service running on a Host, the name of the device or application must be populated in this field. For example “Disk C:\” or “Nic 001”.i

1.0.0

Metric Name

Text

Name of the metric that triggered the alert. For example, “Used Memory” or “Total CPU utilization”.

1.0.0

Type

Text

The type of event. This type might be similar to the Metric Name field, but is used for general grouping of event types.

1.0.0

Message Key

Text

This field is used for de-duplication of events. For example, there might be two events for the same CI, where one event has CPU of 50% and the next event has CPU of 99%. Where both events must be mapped to the same ServiceNow alert, they should have the same message key. The field can be left empty.

1.0.0

Additional Info

Script

This field is referencing a UAC Script in JSON key/value format, and is meant to contain any information that might be of use to the user. It does not map to a pre-defined ServiceNow event field. Examples include IDs of objects in the event source, event priority (if it is not the same as severity), assignment group information, and so on. An example of a script content is below:

{ "pid": "12343", "process_name": "servlssd", "event_priority": "10" }

 

1.0.0

Time Of Event

Text

Time when the event occurred on the event origin. The format is: yyyy-MM-dd HH:mm:ss. If left empty the the current Agent local time is used.

1.0.0

Resolution State

Text

The resolution state of the Event. If left empty the state is New. Possible Values:

  • New – (Default)

  • Closing

1.0.0

Severity

Choice

Severity of the event. Possible Values:

  • – None – (Default)

  • 0 - Clear

  • 1 - Critical

  • 2 - Major

  • 3 - Minor

  • 4 - Warning

  • 5 - OK

1.0.0

Extension Output Options

Choice

Control the Extension Ouput “results”

  • --None-- : No additional information i printed on Extension output “result”. – (Default)

  • Print Detailed Event Information : Event information provided by ServiceNow Endpoint is printed on Extension output “result”.

1.0.0

Provide Additional Fields

Choice

The Provide Additional Fields provided as Choice field. This field allows the user to choose whether to include or not additional ServiceNow fields in the request as a JSON formatted text. The following options are available.

  • -- None --

  • As JSON Text

1.1.0

Additional Fields (JSON)

Text

Additional Fields (JSON) provided as JSON formatted text. Each additional field can be sent as a key/value pair.

Required when Provide Additional Fields is "As JSON Text".

1.1.0

Cancelation and Rerun

In the case of Rerun, the same Event will be sent again to ServiceNow

Exit Codes

Exit Code

Status

Status Description

 Meaning

Exit Code

Status

Status Description

 Meaning

0

Success

“SUCCESS: Task executed successfully.“

Successful Execution

1

Failure

“Execution Failed: <<Error Description>>”

Generic Error. Raised when not falling into the other Error Codes.

2

Failure

“Authentication Error: Account cannot be authenticated.“

Bad credentials

3

Failure

“Authorization Error: Account is not authorized to perform the requested action.“

Insufficient permissions

20

Failure

“Data Validation Error: <<Error Description>>“

Input fields validation error.

STDOUT and STDERR

STDOUT and STDERR provide additional information to User. The populated content can be changed in future versions without notice. Backward compatibility is not guaranteed.

How To

Import Universal Template

To use the Universal Template, you first must perform the following steps.

  1. This Universal Task requires the Resolvable Credentials feature. Check that the Resolvable Credentials Permitted system property has been set to true.

  2. To import the Universal Template into your Controller, follow these instructions.

  3. When the files have been imported successfully, refresh the Universal Templates list; the Universal Template will appear on the list.

Modifications of this integration, applied by users or customers, before or after import, might affect the supportability of this integration. For more information refer to Integration Modifications.

Configure Universal Task

For a new Universal Task, create a new task, and enter the required input fields.

Integration Modifications

Modifications applied by users or customers, before or after import, might affect the supportability of this integration. The following modifications are discouraged to retain the support level as applied for this integration.

  • Python code modifications should not be done.

  • Template Modifications

    • General Section

      • "Name", "Extension", "Variable Prefix", "Icon" should not be changed.

    • Universal Template Details Section

      • "Template Type", "Agent Type", "Send Extension Variables", "Always Cancel on Force Finish" should not be changed.

    • Result Processing Defaults Section

      • Success and Failure Exit codes should not be changed.

      • Success and Failure Output processing should not be changed.

    • Fields Restriction Section
      The setup of the template does not impose any restrictions, However with respect to "Exit Code Processing Fields" section.

      1. Success/Failure exit codes need to be respected.

      2. In principle, as STDERR and STDOUT outputs can change in follow-up releases of this integration, they should not be considered as a reliable source for determining success or failure of a task.

Event Template configuration when related to “Metric Label Attributes” & “Optional Metric Labels” is allowed. However, administrators should be cautious of high cardinality scenarios that might occur.

Users and customers are encouraged to report defects, or feature requests at Stonebranch Support Desk.

Document References

This document references the following documents:

Document Link

Description

Document Link

Description

Universal Templates

User documentation for creating, working with and understanding Universal Templates and Integrations.

Universal Tasks

User documentation for creating Universal Tasks in the Universal Controller user interface.

Changelog

ue-servicenow-event-1.1.0 (2024-08-01)

Enhancements

  • Added support for all ServiceNow Event fields.

Changes

  • This integration is no longer importable on Universal Controller 7.2 or runnable on Agent version 7.2.

ue-servicenow-event-1.0.2 (2024-05-16)

Fixes

  • Fixed: Fixed message_key always being NULL (118251/#36755)

ue-servicenow-event-1.0.1 (2024-04-25)

Fixes

  • Fixed: Fixed bug where the contents of the additional_info field were not being properly recognized by ServiceNow (118066/#36165)

ue-servicenow-event-1.0.0 (2024-03-14)

Initial Version