Setu Recipes: reusable digital workers across every app.Browse templates

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

TypeScript
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.
InputTypeDescription
short_descriptionstringRequiredOne-line summary
descriptionstringOptionalLonger description
urgencystringOptionalUrgency: 1 high, 2 medium, 3 low
impactstringOptionalImpact: 1 high, 2 medium, 3 low
caller_idstringOptionalsys_id or user name of the caller
assignment_groupstringOptionalsys_id or name of the assignment group
TypeScript
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'}.
InputTypeDescription
tablestringRequiredTable name, e.g. change_request
fieldsobjectRequiredColumn names and values for the new record
TypeScript
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).
InputTypeDescription
sys_idstringRequiredIncident sys_id
TypeScript
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.
InputTypeDescription
tablestringRequiredTable name
sys_idstringRequiredRecord sys_id
fieldsstringOptionalComma-separated field names to return
TypeScript
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.
InputTypeDescription
querystringOptionalEncoded query, e.g. active=true^priority=1^ORDERBYDESCsys_created_on
limitintegerOptionalMax records to return
fieldsstringOptionalComma-separated field names to return, e.g. number,short_description,state
TypeScript
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.
InputTypeDescription
tablestringRequiredTable name, e.g. change_request or sys_user
querystringOptionalEncoded query, e.g. active=true^ORDERBYDESCsys_created_on
limitintegerOptionalMax records to return
fieldsstringOptionalComma-separated field names to return
display_valuestringOptionalReturn display values instead of raw values
TypeScript
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.
InputTypeDescription
sys_idstringRequiredIncident sys_id
statestringOptionalState number: 1 New, 2 In Progress, 3 On Hold, 6 Resolved, 7 Closed
urgencystringOptionalUrgency: 1 high, 2 medium, 3 low
impactstringOptionalImpact: 1 high, 2 medium, 3 low
short_descriptionstringOptionalNew one-line summary
work_notesstringOptionalInternal work note to add
commentsstringOptionalCustomer-visible comment to add
close_codestringOptionalResolution code (needed when resolving)
close_notesstringOptionalResolution notes (needed when resolving)
TypeScript
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).
InputTypeDescription
tablestringRequiredTable name
sys_idstringRequiredRecord sys_id
fieldsobjectRequiredColumn names and new values
TypeScript
await setu.execute({
  userId: "user_1",
  action: "servicenow.update_record",
  input: {
    "table": "<table>",
    "sys_id": "<sys_id>",
    "fields": {}
  },
});