File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Server-Side Components/Background Scripts/To check incidents having a VIP caller Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Name: VIP Caller Incidents
3+ * Type: Background Script
4+ * Purpose: Prints all incidents where the caller is a VIP user
5+ * Author: Shashank Jain
6+ */
7+
8+ var inc = new GlideRecord ( 'incident' ) ;
9+ inc . addQuery ( 'caller_id.vip' , true ) ; // Only VIP callers
10+ inc . query ( ) ;
11+ gs . print ( "Incidents with VIP Callers:" ) ;
12+ while ( inc . next ( ) ) {
13+ gs . print ( "Number: " + inc . number + " | Short Description: " + inc . short_description ) ;
14+ }
Original file line number Diff line number Diff line change 1+ # VIP Caller Incidents Background Script
2+
3+ ## Description
4+ This background script fetches all incidents where the caller is marked as a VIP user
5+ and prints the incident number and short description in the logs.
6+
7+ ## Usage
8+ 1 . Go to ** System Definition > Scripts - Background** in ServiceNow.
9+ 2 . Paste the script into the editor.
10+ 3 . Click ** Run Script** .
11+ 4 . Check the output in the logs.
12+
13+ ## Prerequisites
14+ - The User table must have a ** VIP checkbox** (` vip ` field).
15+ - The Incident table must have a ` caller_id ` reference field.
16+
You can’t perform that action at this time.
0 commit comments