Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
VIP Caller — Auto-Set Urgency Client Script (ServiceNow)
Overview

This Client Script automatically sets the Urgency field to High (1) whenever a VIP caller is selected on a ServiceNow form.

It also shows a field-level info message to notify the user why urgency was updated. The script ignores non-VIP callers, ensuring normal behavior for regular users.

Features

Automatically detects when a VIP caller is selected.

Sets the Urgency field to High (1).

Displays a field-level message below the urgency field ("Urgency automatically set to High because caller is VIP").

Works dynamically every time the caller field changes.

Compatible with Classic UI forms.

Ensures non-VIP callers do not trigger urgency changes.

Usage Instructions
1. Create the Client Script

Navigate to System Definition → Client Scripts.

Click New to create a client script.

2. Configure the Script

Name: VIP Caller Urgency

Table: incident

Type: onChange

Field: caller_id

Active: Checked
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

g_form.getReference('caller_id', function(caller) {
if (caller.vip === true || caller.vip === 'true') {
g_form.setValue('urgency', '1');

if (g_form.showFieldMsg) {
g_form.showFieldMsg(
'urgency',
'Urgency automatically set to High because caller is VIP',
'info',
false
);
}
} else {
// Optional: Do nothing or reset urgency
// g_form.setValue('urgency', oldValue);
}
});
}
Loading