GlideClearDashboardCache undefined on Australia Patch 2 — 4 OOTB BRs fail on every PA dashboard save causing widget loss and save failuresDescriptionOn Australia Patch 2, the Java class GlideClearDashboardCache (com.snc.par.dashboards.glide.script.ClearDashboardCache, annotated @GlideScriptable) is not registered in the Rhino scripting scope. The class is present in the com.snc.par.dashboards OSGi bundle JAR (Packages.* returns [JavaPackage ...]) but is not accessible as a Rhino scriptable — typeof GlideClearDashboardCache returns undefined.Four OOTB Business Rules in com.snc.par.dashboards call this class with no try/catch on every INSERT, UPDATE, and DELETE against par_dashboard, par_dashboard_canvas, par_dashboard_widget, and par_dashboard_permission:- Clear cache on par_dashboard - update (sys_id: 8f63bbd253330210ca64ddeeff7b12b3)- Clear cache - par_dashboard_canvas (sys_id: b9b9b0ea53f30210ca64ddeeff7b12da)- Clear cache par_dashboard_widget (sys_id: 4c3575b653f70210ca64ddeeff7b12e1)- Clear cache - par_dashboard_permission (sys_id: 64ddbfde53330210ca64ddeeff7b12b8)When a user saves a PA dashboard, these BRs throw RhinoEcmaError: "GlideClearDashboardCache" is not defined (logged as WARNING in the node log, firing 14+ times per transaction). Two failure modes: (1) dashboard save fails with "Your dashboard could not be saved", or (2) save succeeds but in-memory cache not flushed — stale canvas layouts cause widgets to disappear from tabs on subsequent loads.Confirmed reproducible on supported instances. (australia-patch2, sn_app_analytics_w 8.3.1)Build: australia-patch2 and patch2-hotfix2(both affected).Steps to Reproduce Option1:1. Open any PA dashboard in Analytics Center2. Make an edit and save3. Result A: "Your dashboard could not be saved" error message4. Result B: Save succeeds but widgets disappear from tabs on next load5. Node log shows: *** WARNING *** Evaluator: com.glide.script.RhinoEcmaError: "GlideClearDashboardCache" is not defined — firing 14+ times per transaction Option2:1. Run background script: gs.info('typeof: ' + typeof GlideClearDashboardCache); — returns "undefined"2. Run: gs.info('' + Packages.com.snc.par.dashboards.glide.script.ClearDashboardCache); — returns "[JavaPackage ...]" confirming JAR present but class not Rhino-registered WorkaroundRun this script as a background script with the Admin role in the Global scope- It runs in TEST mode without making any changes. After verification that there are items to fix- change TEST_MODE from true to falsevar TEST_MODE = true; --> var TEST_MODE = false;- and run the script again. // ============================================================// FIX SCRIPT: DEF0856086 — Remove dead GlideClearDashboardCache calls// + reset Customer Modified markers in one pass// ============================================================//// CONTEXT:// PR #11254 deleted the ClearDashboardCache Java class. However, 7 Business// Rules still reference its Glide wrapper (GlideClearDashboardCache), causing// a ReferenceError at runtime whenever a dashboard or related record is saved.// A permanent fix is available in a later update.//// WHAT THIS SCRIPT DOES:// 1. Removes the two dead lines from each of the 7 affected Business Rules:// var parDashboardCache = new GlideClearDashboardCache(dashboardSysId);// parDashboardCache.clearCache();// 2. Immediately deletes the sys_update_xml entry that ServiceNow just created// for the fix, so the upgrade engine sees these BRs as unmodified base-system// records and applies PR #12629 silently — no conflict prompts.//// IDEMPOTENT: Safe to run multiple times. Already-fixed BRs are skipped.//// TEST MODE:// Set TEST_MODE = true to do a dry run — logs what would change without// touching any record or sys_update_xml entry.//// HOW TO RUN:// System Definition → Scripts - Background. Global scope. Admin role required.// ============================================================var TEST_MODE = true; // ← set to false to apply changesvar SCRIPT_ID = 'DEF0856086-Fix' + (TEST_MODE ? '-DRY-RUN' : '');var BUSINESS_RULES = [{ sys_id: '0b4e3f1253730210ca64ddeeff7b1205', name: 'Clear cache - par_dashboard_visibility', table: 'par_dashboard_visibility' },{ sys_id: '3187ff1a53330210ca64ddeeff7b1251', name: 'Clear cache - par_dashboard_tab', table: 'par_dashboard_tab' },{ sys_id: '4c3575b653f70210ca64ddeeff7b12e1', name: 'Clear cache - par_dashboard_canvas', table: 'par_dashboard_canvas' },{ sys_id: '64ddbfde53330210ca64ddeeff7b12b8', name: 'Clear cache - par_dashboard_permission', table: 'par_dashboard_permission' },{ sys_id: '8f63bbd253330210ca64ddeeff7b12b3', name: 'Clear cache on par_dashboard - update', table: 'par_dashboard' },{ sys_id: 'b9b9b0ea53f30210ca64ddeeff7b12da', name: 'Clear cache par_dashboard_widget', table: 'par_dashboard_widget' },{ sys_id: 'ef66052a53370210ca64ddeeff7b1246', name: 'Clear cache par_component', table: 'par_component' }];var results = { fixed: [], skipped: [], missing: [], error: [] };function clearCustomerModifiedMarker(sysId, brName) {var gr = new GlideRecord('sys_update_xml');gr.addQuery('name', 'sys_script_' + sysId);gr.query();while (gr.next()) {var payload = gr.getValue('payload') || '';if (payload.indexOf('GlideClearDashboardCache') === -1) {if (TEST_MODE) {gs.log(' → upgrade marker would be cleared', SCRIPT_ID);} else {gs.log(' → upgrade marker cleared', SCRIPT_ID);gr.deleteRecord();}} else {gs.logWarning(' → WARNING: ' + brName + ' had a prior customer customization.' +' It will appear as Customer Modified during the upgrade — accept the upgrade version when prompted.', SCRIPT_ID);}}}if (TEST_MODE) {gs.log('DRY RUN — no changes will be made', SCRIPT_ID);}BUSINESS_RULES.forEach(function(rule) {var gr = new GlideRecord('sys_script');gr.get(rule.sys_id);if (!gr.isValidRecord()) {gs.logWarning('NOT FOUND: ' + rule.name, SCRIPT_ID);results.missing.push(rule.name);return;}var script = gr.getValue('script');// Idempotency checkif (script.indexOf('GlideClearDashboardCache') === -1) {gs.log('Already clean, skipping: ' + rule.name, SCRIPT_ID);results.skipped.push(rule.name);return;}// Remove the two dead linesvar cleaned = script.replace(/[ \t]*var parDashboardCache\s*=\s*new GlideClearDashboardCache\([^)]*\);[ \t]*\r?\n/g, '').replace(/[ \t]*parDashboardCache\.clearCache\(\);[ \t]*\r?\n?/g, '');// Safety checkif (cleaned.indexOf('GlideClearDashboardCache') !== -1) {gs.logError('ERROR: Could not fully clean ' + rule.name + ' — skipping to avoid partial edit. Fix manually.', SCRIPT_ID);results.error.push(rule.name);return;}if (TEST_MODE) {gs.log('Would fix: ' + rule.name, SCRIPT_ID);clearCustomerModifiedMarker(rule.sys_id, rule.name);} else {gr.setValue('script', cleaned);gr.setWorkflow(false);gr.update();gs.log('Fixed: ' + rule.name, SCRIPT_ID);clearCustomerModifiedMarker(rule.sys_id, rule.name);}results.fixed.push(rule.name);});gs.log('===== SUMMARY' + (TEST_MODE ? ' (DRY RUN)' : '') + ' =====' +'\n ' + (TEST_MODE ? 'Would fix' : 'Fixed') + ' (' + results.fixed.length + '): ' + (results.fixed.join(', ') || 'none') +'\n Skipped (' + results.skipped.length + '): ' + (results.skipped.join(', ') || 'none') +'\n Missing (' + results.missing.length + '): ' + (results.missing.join(', ') || 'none') +'\n Errors (' + results.error.length + '): ' + (results.error.join(', ') || 'none'),SCRIPT_ID);if (TEST_MODE) {gs.log('Set TEST_MODE = false and re-run to apply changes.', SCRIPT_ID);}if (results.error.length > 0) {gs.log('ACTION REQUIRED: ' + results.error.length +' BR(s) could not be fixed automatically. Edit them manually and remove the GlideClearDashboardCache lines.', SCRIPT_ID);}Related Problem: PRB2050123