Service Now Integration Interfaces :
ServiceNow is a Database driven application. Every peace of data and Configurations within the applications are resides inside database.This data and Configurations are often displayed form of modules,options and forms. Every form in the system is essentially a database table.
In Service Now we reference any table by using standard URL format, and to directly access any table or form with in the Service Now instance, simply type the database table name in the URL and Append .do extension to that table name.
Example: Incidents
URL: https://dev12552.service-now.com/incident.do
party applications access the data resides within the table.
automatically accessible to these interfaces.
operations.
CREAD:
C ==> Create
R ==> Read
E ==> Edit
D ==> Delete
All of this interfaces are protected with basic authentication by default
Proof of Concepts Using SOAP UI:
"Soap UI is an open source web service testing application for service-oriented architectures (SOA). Its functionality covers web service inspection, invoking, development, simulation and mocking, functional testing, load and compliance testing."
We can use SOAP web service interface(SOAP UI) tool, If we want to explore Web Services functions available.
==> Installation of SOAP UI tool:
1. Download SOAP UI tool from here www.soapui.org
2. Install the downloaded file and Open the tool
==> Create Project a Project in SOAP UI:
1. Open SoapUI
2. Click File > New SOAP Project
3. Project Name: IncidentInterface
2. Click File > New SOAP Project
3. Project Name: IncidentInterface
4. Add WSDL URL: https://.service-now.com/incident.do?WSDL
5. Click OK to finish
==> Authentication
Alternatively users can also set authentication using Auth option available in bottom of tool
Example 1: Insert new incident
1. Double click the insert operation
2. Update the XML file as needed
Sample XML:
-------------------------------------------------------------------------------------------------------------------------
3. Select the green arrow to submit the soap request
4. You will receive a soap response that the the incident was created. Example response below
-------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
Example 2: Update an existing incident
We need to pass sys_id value of the incident record in XML request for updating an existing incident
Example 3: Delete an Incident
We need to pass sys_id value of the incident record in XML request for deleting an existing incident
========================================================================
Glide:
ServiceNow company name used to be called as Glidesoft, Inc. incorporated in California. Glide name has been incorporated from previous company name.
GlideRecord is a special Java class (GlideRecord.java) that can be used in JavaScript exactly as if it was a native JavaScript class.
Usage:
ServiceNow GlideRecord class is used for querying ServiceNow database to retrieve the one or more records
DB Operations Supported by Glide Record:
1. Update
2. Insert
2. Insert
3. Delete
4. Query
5. Get
6. Set
All 6 different DB operations are provided with multiple function/methods to achieve different use cases. In this post we will learn few examples
Use case 1:
List all incident record numbers in incident table
Where should we execute sample code:
Before we execute the sample GlideRecord code snippet. We should provide security permission
1. Open ServiceNow UI and Click on LOCK icon on Banner section
Where should we execute sample code:
Before we execute the sample GlideRecord code snippet. We should provide security permission
1. Open ServiceNow UI and Click on LOCK icon on Banner section
2. Tick security_admin option(This is required, because we are operating over DB records
3. Click OK
4. Open the coding PAD by appending URL shortcut to the URL(sys.scripts.do)
5. Write the sample code in Run script section and Click on Run button
Alternative Method How to find the Scripts - Background Utility
1. Login as an Admin User
2. Elevate your security privileges to security_admin. Click the Lock icon next your name on the title
Bar
3. Click the security_admin checkbox and click ok. The Lock icon is now unlocked
4. Go to System Defintion > Scripts - Background. The Scripts - Background Utility appears.
========================================================================
3. Click OK
4. Open the coding PAD by appending URL shortcut to the URL(sys.scripts.do)
5. Write the sample code in Run script section and Click on Run button
Alternative Method How to find the Scripts - Background Utility
1. Login as an Admin User
2. Elevate your security privileges to security_admin. Click the Lock icon next your name on the title
Bar
3. Click the security_admin checkbox and click ok. The Lock icon is now unlocked
4. Go to System Defintion > Scripts - Background. The Scripts - Background Utility appears.
========================================================================
//Function definition
ListallIncident();
//Function Body
function ListallIncident()
{
var ListallIncident = new GlideRecord('incident'); ////Indicate the table to query from
ListallIncident.query(); ////Execute the query
//Do something with the records returned
while(ListallIncident.next()) //Operate over all incidents
{
gs.print('Incident Found: '+ListallIncident.number); //Print all incidents
}
}
