Forward schedule of change query in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hello Friends
Can some one share the query for fetching the forward schedule of changes in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
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
Mohammed Mustaq Shaik
