Amar Kutlaria
Mega Guru

Saviynt integration with Servicenow using REST API.

User case: Request services (application access, roles) using Servicenow and automate service/request fulfillment using Saviynt (Identity and Access management system).

Solution:

1. Create appropriate request catalog items in ServiceNow to capture user inputs.

2. Create staging table to store request and user information.

3. Make a REST API call from staging table to Saviynt to generate access token.

4. Make second REST API call from staging table to create request in Saviynt system or combine step 3 and 4.

5. Make third API call using scheduled job at regular interval to check saviynt ticket status (includes step 1 in logic).

6. Update RITM/ticket in Serivcenow with respective status updates and work notes.

7. Update workflow to proceed with next activity and close the request.

 

 

Comments
JD37
Giga Expert

Hi Amar (and anyone else that has a ServiceNow to Saviynt integration in place),

I've been asked to look into a ServiceNow - Saviynt integration. We're at the very early stages of looking into it. What's the minimum role/s the ServiceNow account which Saviynt will use to connect will require, is snc_platform_rest_api_access enough?

Regards

Amar Kutlaria
Mega Guru

Hi JD,

 

In our case, servicenow posted the requests in Saviynt and later checked for status of the request using Saviynt key returned in response during request creation. So both the API calls were made from Servicenow to Saviynt and not the other way. Incase , saviynt needs to make the call to Servicenow, snc_platform_rest_api_access and ITIL should suffice. Please test 

Nagendra7
Kilo Contributor

Hello Amar,

Hope you're doing good.

Can you please help me with the Scheduled job? How this could be achieved? Because i am facing problems while querying for the particular record.

Regards,

Nagendra.

Amar Kutlaria
Mega Guru

Please check below below logic for scheduled job

#5. Make third API call using scheduled job at regular interval to check Saviynt ticket status (includes step 1 in logic).

var completionState;
var svyntStatus;


var gr= new GlideRecord('your staging table');
gr.addEncodedQuery('your condition'); 
gr.query();
//gs.info("Saviynt row:"+gr.getRowCount());


while(gr.next())
{

var key = gr.u_saviynt_key; // Saviynt key

if(key=='')
continue;


// REST API call to get Access Token
var accessToken= new XXXXRESTAPICall().getAccessToken(); // Your script include and function for access token

// REST API call to get Task Details
var response = new XXXXRESTAPICall()._getTaskState(accessToken,key); // your script include and function to get task status update from Saviynt. Please note this function will make an API call to Saviynt end point for task status. In my case it was different end point.


var responseBody1 = response.getBody();
var httpStatus1 = response.getStatusCode();
var parsed = JSON.parse(responseBody1);
var svyntMessage = parsed.msg; // Success or Fail
var svyntCode = parsed.errorCode;


// Update your staging record 


gr.u_response_code = svyntCode;
gr.u_message_completion = svyntMessage;
gr.u_response_completion = responseBody1;
gr.u_http_status_completion = httpStatus1;


if(u_message_completion=='success' || u_message_completion =='User Already Has Access' || u_message_completion=='Discontinued'){
gr.u_status = 'Completed';
gr.u_completion_status = completionState;
gr.update();


}
else
{
gr.u_status = 'Submitted';
gr.u_completion_status = completionState;
gr.setWorkflow(false);
gr.update();
}
//current.setWorkflow(false);

}

 

Ankur5
Kilo Explorer

Hi Amar,

Can you please provide the link to the documentation provided by ServiceNow for integration with Saviynt?

Thanks,

Ankur

ashishdevsingh
Tera Expert

hi @Amar Kutlaria , @Ankur5 ,

 

do you have documentation for setup ? 

katoz97
Mega Explorer

Greetings,

 

I recognize this article is quite old, but I'm hoping someone will be able to assist.  The steps outlined are quite helpful, though when we get to 

2. Create staging table to store request and user information.

 

I have more questions.  Is this considered a "custom table" within SNOW?  Does it require an additional license cost?  If so, is the cost for the service account (from Saviynt) accessing the table or a per user cost for all SNOW users?

 

If the answer is yes to the cost, it becomes quite prohibitive to use the SNOW interface for Saviynt requests and instead we'd need to look at embedding Saviynt Request Form into SNOW.

 

Appreciate the assistance!

 

CindrellaR
Tera Contributor

Does it require a subscription to create a rest api in ServiceNow?

Version history
Last update:
‎10-29-2019 03:39 PM
Updated by: