using REST API Explorer to get List of change request Between a time range

venky1544
Kilo Explorer

HI

I would like to pull the list of change request from a date range using REST API explorer

can you please help me

1 ACCEPTED SOLUTION

For eg; 

sys_created_onBETWEENjavascript:gs.dateGenerate('2018-12-17','00:00:00')@javascript:gs.dateGenerate('2018-12-18','23:59:59')

will give you all records created today and yesterday. This query is copied from the filter applied on a table and you could paste it on your API Explorer.

find_real_file.png

View solution in original post

7 REPLIES 7

This solution is not working pls help me on this 

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

1. Navigate to the Change Request List view and apply the filter as per your requirement and then copy the filter condition

https://docs.servicenow.com/bundle/london-platform-user-interface/page/use/using-lists/task/t_GenEncodQueryStringFilter.html

 

2. Now navigate to Rest API Explorer->Click on the Related link "Retrieve Records from Table (Get)-> Select the Table name as Change Request and in the sysparm_query pass the filter which is copied.

find_real_file.png

 

-Pradeep Sharma

venky1544
Kilo Explorer

Hi Guys

Just wanted to also know if I use a python script to trigger this API

will the script recognise this variable     (javascript:gs.dateGenerate) highlighted in the sysparm query