From 766d3fae7b26dc2bf4d216ce7d9593f5ff24412c Mon Sep 17 00:00:00 2001 From: Shashank_Jain Date: Thu, 2 Oct 2025 12:38:50 +0530 Subject: [PATCH 1/4] VIP-caller-incidents.js --- .../VIP-caller-incidents.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js diff --git a/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js b/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js new file mode 100644 index 0000000000..75e1d84d7f --- /dev/null +++ b/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js @@ -0,0 +1,14 @@ +/** + * Name: VIP Caller Incidents + * Type: Background Script + * Purpose: Prints all incidents where the caller is a VIP user + * Author: Shashank Jain + */ + +var inc = new GlideRecord('incident'); +inc.addQuery('caller_id.vip', true); // Only VIP callers +inc.query(); +inc.print("Incidents with VIP Callers:"); +while (inc.next()) { + gs.print("Number: " + inc.number + " | Short Description: " + inc.short_description); +} From 688c9daa7bd54a36736ec431068aecfeb16bfd7e Mon Sep 17 00:00:00 2001 From: Shashank_Jain Date: Thu, 2 Oct 2025 12:39:36 +0530 Subject: [PATCH 2/4] readme.md --- .../readme.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Server-Side Components/Background Scripts/To check incidents having a VIP caller/readme.md diff --git a/Server-Side Components/Background Scripts/To check incidents having a VIP caller/readme.md b/Server-Side Components/Background Scripts/To check incidents having a VIP caller/readme.md new file mode 100644 index 0000000000..81c83e8e75 --- /dev/null +++ b/Server-Side Components/Background Scripts/To check incidents having a VIP caller/readme.md @@ -0,0 +1,16 @@ +# VIP Caller Incidents Background Script + +## Description +This background script fetches all incidents where the caller is marked as a VIP user +and prints the incident number and short description in the logs. + +## Usage +1. Go to **System Definition > Scripts - Background** in ServiceNow. +2. Paste the script into the editor. +3. Click **Run Script**. +4. Check the output in the logs. + +## Prerequisites +- The User table must have a **VIP checkbox** (`vip` field). +- The Incident table must have a `caller_id` reference field. + From c08aaae5e8b4defa0cea5178c1b923e3293227d9 Mon Sep 17 00:00:00 2001 From: Shashank_Jain Date: Thu, 2 Oct 2025 14:05:50 +0530 Subject: [PATCH 3/4] Update VIP-caller-incidents.js --- .../VIP-caller-incidents.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js b/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js index 75e1d84d7f..c008e1a1f4 100644 --- a/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js +++ b/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js @@ -8,7 +8,7 @@ var inc = new GlideRecord('incident'); inc.addQuery('caller_id.vip', true); // Only VIP callers inc.query(); -inc.print("Incidents with VIP Callers:"); +gs.print("Incidents with VIP Callers:"); while (inc.next()) { gs.print("Number: " + inc.number + " | Short Description: " + inc.short_description); } From 80f908f0f88d6e2fef70a5da657fa1d74b43b841 Mon Sep 17 00:00:00 2001 From: Shashank_Jain Date: Thu, 2 Oct 2025 14:06:12 +0530 Subject: [PATCH 4/4] VIP-caller-incidents.js --- .../VIP-caller-incidents.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js b/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js index c008e1a1f4..debd9abe83 100644 --- a/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js +++ b/Server-Side Components/Background Scripts/To check incidents having a VIP caller/VIP-caller-incidents.js @@ -2,7 +2,7 @@ * Name: VIP Caller Incidents * Type: Background Script * Purpose: Prints all incidents where the caller is a VIP user - * Author: Shashank Jain + * Author: Shashank Jain */ var inc = new GlideRecord('incident');