- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 01:58 AM
I am using the REST API to get details of a CI instance :
Example https://dev20622.service-now.com/api/now/cmdb/instance/cmdb_ci_appl/82992eb60ad337024fbb6d06a866c636
In the response received I can see the link to the Maintenance Schedule for the CI, but when I query the Maintenance Schedule, I cannot seem to extract the start and end dates of the schedule. Can you please let me know how to go about getting all Maintenance windows associated with a CI using REST API?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 06:31 PM
Hi ,
I see in Table cmn_schedule_span Two Fields:
Name:- Actual Name of Schedule Window
Schedule- Name of Maintenance Schedule (Stored In this Table-cmn_schedule_maintenance)
Now Store the Name of Maintenance Schedule and do lookup in Table cmn_schedule_span based on this value.
You will get the name of Schedule Window and from here you can fetch the data for Start and End Date.
Attaching Screen shot for More Clarity.
Regards
RP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 10:38 AM
Thank you for the quick response again, Rahul!
I tried looking at the cmn_schedule_span table. Like you said it has all the necessary information that I need, like the maintenance schedule entries.
Querying this table with the sys_id of the schedule though, returns nothing. So I tried other parameters like querying the cmn_schedule_span table with the name of the schedule, but again it returns nothing.
Would you know of a way to query the entries with the Schedule SysId or Schedule Name as these are the only two bits of information that I have to query the maintenance entries
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 06:31 PM
Hi ,
I see in Table cmn_schedule_span Two Fields:
Name:- Actual Name of Schedule Window
Schedule- Name of Maintenance Schedule (Stored In this Table-cmn_schedule_maintenance)
Now Store the Name of Maintenance Schedule and do lookup in Table cmn_schedule_span based on this value.
You will get the name of Schedule Window and from here you can fetch the data for Start and End Date.
Attaching Screen shot for More Clarity.
Regards
RP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2018 06:47 AM
Thank you RP for the response. Yes, this works perfectly from the UI and I can see all the schedule span entries linked to the schedule and can create a filter for to query the schedule spans by maintenance schedule name.
But when I access the same information via REST API, I get empty rows unfortunately.
https://<SN Instance>/api/now/table/cmn_schedule_span?sysparm_fields=schedule.name=Application+FLX
The above url queries the "cmn_schedule_span" table for schedules with name "Application FLX" and my response comes up as empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2018 12:59 PM
Hi,
I got it to work, the following API query worked well:
https://<SN>/api/now/table/cmn_schedule_span?sysparm_query=schedule.sys_id=04e664654a36232701a2247dcd8fc4cf
Thank you for your time & support!
Kind Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2018 05:55 PM
Good That It worked Now. Please close the thread .
Regards
RP