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..debd9abe83 --- /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(); +gs.print("Incidents with VIP Callers:"); +while (inc.next()) { + gs.print("Number: " + inc.number + " | Short Description: " + inc.short_description); +} 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. +