// This script will retrieve the most recent Mass Update First 50 plan from the sys_batch_install_plan table and log its name, sys_id, and a URL to access it. // created by: JWJ0215 // created on: 2024-06-15 // Replace 'Mass Update First 50' with the desired plan name prefix if needed. // use this script in the Scripts - Background module to quickly access the latest plan. // Note: This script assumes that there is at least one plan with the specified name prefix in the sys_batch_install_plan table. // It will log the name, sys_id, and a URL to access the plan in the system. // USE THIS FIRST TO CHECK IF THE PLAN EXISTS BEFORE RUNNING ANY OTHER SCRIPTS THAT DEPEND ON IT. var gr = new GlideRecord('sys_batch_install_plan'); gr.addQuery('name', 'STARTSWITH', 'Mass Update First 50'); gr.orderByDesc('sys_created_on'); gr.setLimit(1); gr.query(); if (gr.next()) { gs.info('Name: ' + gr.getDisplayValue('name')); gs.info('Sys ID: ' + gr.getUniqueValue()); gs.info( gs.getProperty('glide.servlet.uri') + 'sys_batch_install_plan.do?sys_id=' + gr.getUniqueValue() ); } else { gs.info('No Mass Update First 50 plan found'); }