×
ServiceNow

Overview

Security Flow’s ServiceNow plugin provides the ability to manage table records, manage a record’s attachments, and download a record’s attachments.

Functionality

The plugin provides the following functionality.

  • Find matching records in a ServiceNow table.
  • Create a record in a ServiceNow table.
  • Update a record in a ServiceNow table.
  • Create or update a record in a ServiceNow table.
  • Delete a record in a ServiceNow table.
  • Attach file(s) to a record within a ServiceNow table.
  • Delete attached file(s) from a record within a ServiceNow table.
  • Download attached file(s) from a record within a ServiceNow table.
  • Retrieve attached file information from a record within a ServiceNow table.

Instance Configuration Parameters

Property
Description

Instance Name

Name for ServiceNow instance.


Unique ID

A system-wide unique identifier for this plugin instance used to locate the service.


Server

Server name for the ServiceNow platform without the protocol. E.g., [instance-name].service-now.com.


Username

User authorized to access the server. This user’s permissions determine the actions the ServiceNow node is allowed to perform.


Password

Password associated with the username.


Password Confirmation

Retype the password used in the Password field.

Flow Node

The ServiceNow node provides an interface for defining request for CRUD (create, read, update, delete) operations within ServiceNow using the ServiceNow APIs. The node properties are in the following table.
Property
Description

Name

The display name of the node within the flows.


Unique ID

System-wide unique ID of the plugin instance.


Table

A drop down seeded with a list of task table labels. Note, the table name is different than the label. See ServiceNow’s Tables and classes page for a more complete list of available Table Names. If a search is to be done on a different table or a user defined table, manually enter a table name (not a table label).


Action

Selects the desired operation to be performed.

  • Create: Creates a new record with the properties provided in the property list.
  • Find: Finds and returns a list of entries matching the search criteria in the property list provided. Returns all entries if no search criteria is provided. Returns an empty list if criteria does not match any entry in the selected table.
  • Delete: Deletes the entry with the provided number. Requires a System ID (sys_id or number) to be supplied to locate the record.
  • Update: Updates the entry with the provided number with the update property list provided. Requires a System ID (sys_id or number) to be supplied to locate the record.
  • Update or Create: Looks for a record matching the property search criteria. If found, an update is made to the table entry with the update property list provided by the user. If not found, a new entry is created with the update property list provided by user. Rejects the request if more than one matching table entry is found.
  • Attach File(s): Adds the matching files associated with the current message to the record specified by System Id (sys_id only).
  • Delete Attached File(s): Deletes file(s) from the ServiceNow attachment table.
  • Download Attached File(s): Downloads file(s) from the ServiceNow attachment table.
  • Get Attached File(s): Retrieves the file records attached to the record specified by System ID (sys_id only).

Display Value

Determines the type of data returned. For Actual Value, the returned results contain the actual values from the database. Choice will be numeric and reference fields will be sys_id values. For Display Value, the returned results contain the display values for all fields. Choice fields will be more descriptive and reference fields will be the display field of the referenced record. For Both Actual and Display Values, the returned results contain both actual values and display values. All fields become objects containing this information. For more details, visit the SeviceNow Table API page.


System ID

The sys_id or number field of the table. Required to perform delete and update operations. The following contexts are supported.

  • msg.: This selects part of the incoming message as the source of the data. This is typical choice.
  • flow.: This selects part of the flow context’s saved data as the source. This information is shared with only the nodes on a given tab.
  • global.: This selects part of the global context’s saved data as the source. This information is shared by all nodes regardless of tab.
  • String: Basic string input.

Mode

Defines the mode of operation when constructing a condition statement.

  • Guided: Exposes an input area for defining a list of logically AND’ed conditions.
  • Expert: Exposes an input area for defining a complex free-form condition statement.

Search Fields

When the Action is Find or Update or Create and in Guided mode, this field defines a list of the criteria for constructing a condition statement.
The list of criteria is logically AND’ed together. The Property field is seeded with column names for searching, but support entering of any column name.


Condition Statement

When the Action is Find or Update or Create and in Expert mode, a free-form entry area provides a template based format for defining the condition statement. The expert mode filter uses variable substitution from the incoming message using a mustache format. A mustache is a set of double curly braces surrounding a variable, i.e. {{ variable }}. For example, {{payload.data}} would substitute in the value of payload.data found in the incoming message.


Fields

Property:

The name of the instance’s property.

Value:

The value of the instance’s property. The following contexts are supported.

  • msg.: This selects part of the incoming message as the source of the data. This is typical choice.
  • flow.: This selects part of the flow context’s saved data as the source. This information is shared with only the nodes on a given tab.
  • global.: This selects part of the global context’s saved data as the source. This information is shared by all nodes regardless of tab.
  • String: Basic string input

Add Attachment(s)

If specified, only file names matching the glob pattern, e.g. “*.foo”, are added as attachments to the record. If left blank, all files associated with the current message are added as attachments to the record.


File Record(s)

A file record entry or an array of file record entries. The file records are retrieved by the Get Attached File(s) action and the Attach File(s) action. For file related actions to function, the file records must contain the sys_id, file_name, and content_type. A value of Standard File Record IDs Location evaluates to the array of file records returned by the actions. A value of Standard First File Record IDs Location evaluates to the first element of the array of file records returned by the actions.

Learn More

Searching Examples

JSON Message Format

The following samples show the JSON content added to the message payload, which conform to Node Messaging Format. The content exists within the servicenow object. The following examples use sn1 for the Unique Id of the plugin:

Find, Create, Update Success

The italicized, green text is inserted into the message payload upon a successful request to retrieve, create, or update an object.

"payload": {
    "servicenow":
      "sn1": {
        "response": [{
          "sys_tags":"",
          "user_input":"",
          "calendar_stc":"",
          "subcategory":"",
          "watch_list":"",
          "follow_up":"",
          "made_sla":"true",
          "sys_created_by":"admin",
          "sla_due":"",
          "number":"INC0000057",
          "group_list":"",
          "reassignment_count":"0",
          "assigned_to":"",
          "sys_mod_count":"1",
          "notify":"1",
          "resolved_by":"",
          "upon_reject":"cancel",
          "additional_assignee_list":"",
          "category":"inquiry",
          "closed_at":"",
          "cmdb_ci":"",
          "contact_type":"",
          "impact":"3",
          "rfc":"",
          "expected_start":"",
          "knowledge":"false",
          "sys_updated_by":"admin",
          "caused_by":"",
          "comments":"",
          "closed_by":"",
          "priority":"5",
          "state":"1",
          "sys_id":"78271e1347c12200e0ef563dbb9a7109",
          "opened_at":"2016-08-10 16:14:59",
          "child_incidents":"0",
          "work_notes":"",
          "delivery_task":"",
          "short_description":"test1",
          "comments_and_work_notes":"",
          "time_worked":"",
          "upon_approval":"proceed",
          "company":{
            "link":"https://[instance-name].service-now.com/api/now/table/core_company/31bea3d53790200044e0bfc8bcbe5dec",
            "value":"31bea3d53790200044e0bfc8bcbe5dec"
          },
          "business_stc":"",
          "correlation_display":"",
          "sys_class_name":"incident",
          "delivery_plan":"",
          "location":"",
          "description":"this is a test",
          "parent":"",
          "close_notes":"",
          "business_duration":"",
          "problem_id":"",
          "sys_updated_on":"2018-05-10 16:18:25",
          "approval_history":"",
          "approval_set":"",
          "business_service":"",
          "reopened_by":"",
          "calendar_duration":"",
          "caller_id":{
            "link":"https://[instance-name].service-now.com/api/now/table/sys_user/7a82abf03710200044e0bfc8bcbe5d27",
            "value":"7a82abf03710200044e0bfc8bcbe5d27"
          },
          "active":"true",
          "approval":"not requested",
          "parent_incident":"",
          "sys_domain_path":"/",
          "hold_reason":"",
          "activity_due":"",
          "severity":"3",
          "incident_state":"1",
          "resolved_at":"",
          "due_date":"",
          "work_start":"",
          "work_end":"",
          "work_notes_list":"",
          "sys_created_on":"2016-08-10 16:14:59",
          "correlation_id":"",
          "escalation":"0",
          "reopened_time":"",
          "opened_by":{
            "link":"https://[instance-name].service-now.com/api/now/table/sys_user/6816f79cc0a8016401c5a33be04be441",
            "value":"6816f79cc0a8016401c5a33be04be441"
          },
          "close_code":"",
          "assignment_group":"",
          "sys_domain":{
            "link":"https://[instance-name].service-now.com/api/now/table/sys_user_group/global",
            "value":"global"
          },
          "order":"",
          "urgency":"3",
          "reopen_count":"0"
      }]
    }
}

Delete Success

The italicized, green text is inserted into the message payload upon a successful request to retrieve, create, or update an object.

"payload": {
    "servicenow": {
      "sn1": {
        "status":"record deleted",
      }
    }
}

Error

The italicized, maroon text is inserted into the message payload upon a failed request.

"payload": {
    "servicenow": {
      "sn1": {
        "error": {
            "error_code": 5,
            "error_message": "Error text"
        }
      }
    }
}
Nevelex Labs, Main Office

Metro Office Park
2950 Metro Drive, Suite 104
Bloomington, MN 55425
Phone: +1 952-500-8921

©Nevelex Labs, LLC. 2018-2024, All Rights Reserved.

EULA