×

IDMWORKS Blog

SailPoint IIQ and ServiceNow custom integration using ServiceNow REST APIs (ServiceNow Table API) – PART 2


SailPoint IIQ provides many out-of-the-box (OOTB) options to integrate with ServiceNow. Though OOTB integrations are great for most of the common use cases, it lacks the flexibility and provides less control over the entire process. Many times we come across a requirement where we need total control, and that’s where this custom integration can be very useful.

Note: This is the second part of the series and covers the Service Catalog request management.  Please review Part 1 of this series which covers the prereqs, basic configuration, and incident management in detail.

Creating ServiceCatalog request in ServiceNow using REST APIs

ServiceCatalog requests (SR) are different than incidents. Some of the options available for incidents are not available for SR and vice-versa. The process of creating SR is more complicated than the process of creating incidents and involves sending multiple REST calls and useing the output of the first call as the input of subsequent steps.

The example below assumes all the prereqs from Part 1 of this blog series. This example also assumes that Service Catalog is already available on SN (catalog requests will be created under Service Catalog). If the requirement is to set the custom variables in request item, then you must create the variable template in request item before you try to do it through REST APIs.

Process To Create Service Catalog Request

  1. 1. Create Service Catalog Request (SR).
  2. 2. Create Request item (RI)
  3. 3. Create the custom variable and update its value.
  4. 4. Correlate the custom variable created in step3 with RI created in step2 using sys_id.
  5. 5. Correlate the RI back to SR using sys_id

 

SN object to SN Table mapping 

No. ServiceNow Object ServiceNow Table
1 SN Catalog request sc_request
2 SN Catalog request item sc_req_item
3 SN Catalog item variable sc_req_item_option
4 SN variable and request item correlation sc_req_item_mtom



Refer to the table below for SN URIs, operations, and HTTP Verbs.

No. Operation URI HTTP Verb
1 Create new Service Catalog Request https://xxx.service-now.com/api/now/v1/table/sc_request

 

POST
2 Get the existing Service Catalog Request from ServiceNow https://xxx.service-now.com/api/now/v1/table/sc_request/sys_id

Note: sys_id is internal system identifier of SR object created earlier.

 

Examples:

Sys_id: 1a451fad4ff3130081630fbf9310c7b0

GET
3 Update the Service Catalog Request created earlier https://xxx.service-now.com/api/now/v1/table/sc_request/sys_id

Note: sys_id is internal system identifier of Service Catalog Request object created earlier.

 

Examples:

Sys_id: 1a451fad4ff3130081630fbf9310c7b0

PUT
4 Create new Request Item https://xxx.service-now.com/api/now/v1/table/sc_req_item

 

POST
5 Update request item https://xxx.service-now.com/api/now/v1/table/sc_req_item/sys_id

 

PUT
6 Create Variable https://xxx.service-now.com/api/now/v1/table/sc_item_option

 

POST
7 Create Variable correlation with request item https://xxx.service-now.com/api/now/v1/table/sc_item_option_mtom

 

POST

ServiceNow exposes multiple ways to authenticate. For this blog, we will use “basic authentication”. You can find more about basic authentication here.

The Prereqs

The following variable values must be gathered before you start the implementation:

No. Variable E.g. Value Comments
1 EndpointURL https://xxx.service-now.com/api/now/v1/table Common portion of the SN URI. The suffix can be added to base URI to generate table specific URI
2 Username admin Username is used in basic authentication. This user must have the appropriate rights to manage incidents in SN
3 Password P#ss&rd134 Password is used in basic authentication.
4 CallerID 1a451fad4ff3130081630fbf933454 Sys_id of the caller, this is the sys_id of the SN user who will be set as a requester of an incident.
5 CatalogID 58d41bad4ff313dfd1630fbf9310cdsfds6 Sys_id of the service catalog
6 variableTemplateID 80sdf4d3ad4ff3130081630fbf9310c7zdf Sys_id of the variable template

This example expects the custom IIQ object which holds the ServiceNow connection details. Please refer Part 1 of this blog series to add the CatalogID, variableTemplateID

The Implementation

Workflow implementation can be anything, for detailed information and variable details, please refer to Part 1 of this blog series.

The following script is responsible for creating the service requests in SN. Code comments should help understanding overall flow of the request.

Closing request is the same as that of closing incidents. Please refer Part 1 of this blog series for the code. Just replace the value of variable “input” with field relevant to your implementation.

Questions, comments or concerns? Feel free to reach out to us below, or email us at IDMWORKS to learn more about how you can protect your organization and customers.

Leave a Reply

Your email address will not be published. Required fields are marked *