From 99e4bd3eb09b54b2962b11f0471273b1d325ad75 Mon Sep 17 00:00:00 2001 From: prudvi-sai-posetty Date: Tue, 28 Oct 2025 15:03:37 +0530 Subject: [PATCH 1/2] captureScheduledJob.js --- .../captureScheduledJob.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Server-Side Components/Background Scripts/Capture Scheduled Job in an Update set/captureScheduledJob.js diff --git a/Server-Side Components/Background Scripts/Capture Scheduled Job in an Update set/captureScheduledJob.js b/Server-Side Components/Background Scripts/Capture Scheduled Job in an Update set/captureScheduledJob.js new file mode 100644 index 0000000000..91e52d6407 --- /dev/null +++ b/Server-Side Components/Background Scripts/Capture Scheduled Job in an Update set/captureScheduledJob.js @@ -0,0 +1,4 @@ +var gr = new GlideRecord('sysauto_script'); +gr.get(''); +var gum = new GlideUpdateManager2(); +gum.saveRecord(gr); From 3ea520b8913dca1b43268ce01197dfe13596d8d9 Mon Sep 17 00:00:00 2001 From: prudvi-sai-posetty Date: Tue, 28 Oct 2025 15:05:55 +0530 Subject: [PATCH 2/2] README.md --- .../Capture Scheduled Job in an Update set/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Server-Side Components/Background Scripts/Capture Scheduled Job in an Update set/README.md diff --git a/Server-Side Components/Background Scripts/Capture Scheduled Job in an Update set/README.md b/Server-Side Components/Background Scripts/Capture Scheduled Job in an Update set/README.md new file mode 100644 index 0000000000..ab2329b291 --- /dev/null +++ b/Server-Side Components/Background Scripts/Capture Scheduled Job in an Update set/README.md @@ -0,0 +1,5 @@ +Scheduled Job Update Set Capture Script + +This ServiceNow background script addresses a critical deployment challenge by programmatically capturing scheduled jobs in update sets. +By default, ServiceNow scheduled jobs are not automatically captured in update sets, making them difficult to migrate between environments. +This script uses the GlideUpdateManager2 API to force a scheduled job record into the current update set, enabling seamless deployment through standard update set processes.