Integrations / ServiceNow
ServiceNow
ServiceNow instance Table API: list, read, create and update incidents, and read or write records of any table you are allowed to use.
8 actions
API key
4 read4 write
Calls service-now.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "servicenow" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Create incidentwriteservicenow.create_incidentCreate an incident with a short description and optional urgency, impact and description. ServiceNow assigns the INC number.
| Input | Type | Description | |
|---|---|---|---|
short_description | string | Required | One-line summary |
description | string | Optional | Longer description |
urgency | string | Optional | Urgency: 1 high, 2 medium, 3 low |
impact | string | Optional | Impact: 1 high, 2 medium, 3 low |
caller_id | string | Optional | sys_id or user name of the caller |
assignment_group | string | Optional | sys_id or name of the assignment group |
await setu.execute({
userId: "user_1",
action: "servicenow.create_incident",
input: {
"short_description": "<short_description>"
},
});Create table recordwriteservicenow.create_recordInsert a record into any ServiceNow table. 'fields' is an object of column names and values, for example {short_description: 'Replace laptop'}.
| Input | Type | Description | |
|---|---|---|---|
table | string | Required | Table name, e.g. change_request |
fields | object | Required | Column names and values for the new record |
await setu.execute({
userId: "user_1",
action: "servicenow.create_record",
input: {
"table": "<table>",
"fields": {}
},
});Get incidentreadservicenow.get_incidentGet one incident by its sys_id (the 32-character record ID, not the INC number; use list_incidents with query number=INC0010002 to find it).
| Input | Type | Description | |
|---|---|---|---|
sys_id | string | Required | Incident sys_id |
await setu.execute({
userId: "user_1",
action: "servicenow.get_incident",
input: {
"sys_id": "<sys_id>"
},
});Get table recordreadservicenow.get_recordGet one record of any ServiceNow table by its sys_id. Returns the raw result.
| Input | Type | Description | |
|---|---|---|---|
table | string | Required | Table name |
sys_id | string | Required | Record sys_id |
fields | string | Optional | Comma-separated field names to return |
await setu.execute({
userId: "user_1",
action: "servicenow.get_record",
input: {
"table": "<table>",
"sys_id": "<sys_id>"
},
});List incidentsreadservicenow.list_incidentsList incidents, filtered with a ServiceNow encoded query such as 'active=true^priority=1' and sorted with ORDERBYDESCsys_created_on.
| Input | Type | Description | |
|---|---|---|---|
query | string | Optional | Encoded query, e.g. active=true^priority=1^ORDERBYDESCsys_created_on |
limit | integer | Optional | Max records to return |
fields | string | Optional | Comma-separated field names to return, e.g. number,short_description,state |
await setu.execute({
userId: "user_1",
action: "servicenow.list_incidents",
input: {},
});List table recordsreadservicenow.list_recordsList records of any ServiceNow table (change_request, problem, sys_user, cmdb_ci, ...) with an encoded query. Returns the raw result.
| Input | Type | Description | |
|---|---|---|---|
table | string | Required | Table name, e.g. change_request or sys_user |
query | string | Optional | Encoded query, e.g. active=true^ORDERBYDESCsys_created_on |
limit | integer | Optional | Max records to return |
fields | string | Optional | Comma-separated field names to return |
display_value | string | Optional | Return display values instead of raw values |
await setu.execute({
userId: "user_1",
action: "servicenow.list_records",
input: {
"table": "<table>"
},
});Update incidentwriteservicenow.update_incidentUpdate an incident: change its state, urgency, impact, short description or add a work note or comment.
| Input | Type | Description | |
|---|---|---|---|
sys_id | string | Required | Incident sys_id |
state | string | Optional | State number: 1 New, 2 In Progress, 3 On Hold, 6 Resolved, 7 Closed |
urgency | string | Optional | Urgency: 1 high, 2 medium, 3 low |
impact | string | Optional | Impact: 1 high, 2 medium, 3 low |
short_description | string | Optional | New one-line summary |
work_notes | string | Optional | Internal work note to add |
comments | string | Optional | Customer-visible comment to add |
close_code | string | Optional | Resolution code (needed when resolving) |
close_notes | string | Optional | Resolution notes (needed when resolving) |
await setu.execute({
userId: "user_1",
action: "servicenow.update_incident",
input: {
"sys_id": "<sys_id>"
},
});Update table recordwriteservicenow.update_recordChange fields of an existing record in any ServiceNow table (PATCH: only the fields you send change).
| Input | Type | Description | |
|---|---|---|---|
table | string | Required | Table name |
sys_id | string | Required | Record sys_id |
fields | object | Required | Column names and new values |
await setu.execute({
userId: "user_1",
action: "servicenow.update_record",
input: {
"table": "<table>",
"sys_id": "<sys_id>",
"fields": {}
},
});