Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Forward schedule of change query in ServiceNow

amitmanna
Giga Expert

Hello Friends

Can some one share the query for fetching the forward schedule of changes in ServiceNow 

1 REPLY 1

Me Being Mustaq
Giga Guru

Hi @amitmanna ,

 

You'll typically query the Change Request table (change_request) for changes that are scheduled in the future. Here's a sample query using GlideRecord in a script or a filter condition you can use in a report or module:

for changes that are scheduled in the future. Here's a sample query using GlideRecord in a script or a filter condition you can use in a report or module

var gr = new GlideRecord('change_request');
gr.addQuery('start_date', '>=', gs.nowDateTime()); // Only future changes
gr.addQuery('state', '!=', '3'); // Exclude 'Closed' changes
gr.orderBy('start_date'); // Sort by start date
gr.query();

while (gr.next()) {
gs.print('Change: ' + gr.number + ' | Start: ' + gr.start_date + ' | End: ' + gr.end_date);
}

 

You can use this in a list view or report:

Filter:- Start date is on or after Today AND State is not Closed

 

If it is helpful, please hit the thumbs-up button and accept the correct solution by referring to this solution in the future. It will be helpful to them.

 

Thanks & Regards,

Mohammed Mustaq Shaik

 

 

 

 

 

Thanks & Regards,

Mohammed Mustaq Shaik