Schedule Change Request AI Agent - "Report the conflicting schedules" tool fails with TypeError when all maintenance schedules have no time entries in the date rangeIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } When using the "Schedule Change Request AI Agent," the tool "Report the conflicting schedules" fails with the error "Sorry, there was a problem on my side trying to complete this request. Try asking again later." This occurs when a change request's CI has two or more matching maintenance schedules, and none of those schedules have active time entries within the date range being evaluated. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } IT Service Management AI agent collection version 6.0.8 Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Root CauseThe AI Agent's conflict resolution logic does not handle scenarios where two or more maintenance schedules apply to a change request and none of them have active schedule entries within the date range, resulting in a TypeError: Cannot Convert null to an object. Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Steps to Resolve1. You can run the following script by replacing the change number in the variable to verify all the schedules that apply for your change:var changeNumber = ''; // Change this to the change request number you want to testvar change = new GlideRecord('change_request');change.addQuery('number', changeNumber);change.query();if (change.next()) { gs.info('Change: ' + changeNumber + ' | CI: ' + change.cmdb_ci.getDisplayValue() + ' (' + change.cmdb_ci.sys_class_name + ')'); var start = new GlideDateTime(change.getValue('start_date')); var end = new GlideDateTime(change.getValue('end_date')); var range = { start_date: start, end_date: end }; var cs = new global.ChangeConflictSchedule(change, start, end, range); var schedules = cs.getSchedules(); cs.buildMaintenanceSchedules(schedules.maintenance); var keys = Object.keys(cs.maintenanceSchedules); gs.info('Total maintenance schedules evaluated: ' + keys.length); for (var i = 0; i < keys.length; i++) { var schedId = keys[i]; if (schedId === '247') { gs.info(' [' + (i + 1) + '] SysID: 247 (auto-generated 24x7 schedule - no maintenance schedules matched)'); continue; } var schedGr = new GlideRecord('cmn_schedule'); if (schedGr.get(schedId)) { var tm = cs.maintenanceSchedules[schedId].getTimeMap(cs.rangeStart, cs.rangeEnd); gs.info(' [' + (i + 1) + '] SysID: ' + schedId + ' | Name: ' + schedGr.getDisplayValue('name') + ' | isEmpty: ' + tm.isEmpty()); } else { gs.info(' [' + (i + 1) + '] SysID: ' + schedId + ' | Name: (not found in cmn_schedule)'); } }} else { gs.info('Change not found: ' + changeNumber);} 2. If there are no schedules that get returned with "SysID: ef34..... | Name: test.... | isEmpty: false." it indicates that all the schedules that apply for the change do not have a scheduled entry. 3. Create a maintenance schedule record in cmn_schedule_maintenance and have it apply for the change by modifying the condition. Make sure at least 1 schedule returns isEmpty as false. 4. Monitor the issue as it has been tracked with the product team via PRB2023593.