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 empdmoeypg (glide-australia-02-11-2026__patch2-04-17-2026, sn_app_analytics_w 8.3.1). 7 customer cases confirmed. See also DEF0829277 (Can't Confirm, same symptom).Build: glide-australia-02-11-2026__patch2-04-17-2026 (base) and patch2-hotfix2-06-18-2026 (both affected).Steps to Reproduce Option1:1. Open any PA dashboard in Analytics Center2. Make any edit and save3. Result A: "Your dashboard could not be saved" error4. 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 using Admin (Global scope) - It will run it in TEST mode without doing any change. Once it verifies that there are things to fix - change the test mode to be false var 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. // PR #12629 (track/dataanalyticsdefects) is the permanent fix. // // 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 changes var 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 check if (script.indexOf('GlideClearDashboardCache') === -1) { gs.log('Already clean, skipping: ' + rule.name, SCRIPT_ID); results.skipped.push(rule.name); return; } // Remove the two dead lines var cleaned = script .replace(/[ \t]*var parDashboardCache\s*=\s*new GlideClearDashboardCache\([^)]*\);[ \t]*\r?\n/g, '') .replace(/[ \t]*parDashboardCache\.clearCache\(\);[ \t]*\r?\n?/g, ''); // Safety check if (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