- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2017 11:27 PM
As checked here Useful Task Scripts - ServiceNow Wiki, we have the following code which could be included in client scripts for VIP users. I have tried it on my instance and it is not working as specified in the document.
Change Urgency to High if User is VIP
name = Change Urgency to High if User is VIP
type = Client Script
table = Incident
param = Field = Caller
description = This is an onChange client script that will check to see if the caller is a VIP (based on the VIP field on the user record), if so change the urgency to high.
function onChange(control, oldValue, newValue, isLoading) {
//If the page isn't loading
if (!isLoading) {
//If the new value isn't blank
if (newValue != '') {
//If inc is already urgency of high no need to go on
if (g_form.getValue('urgency') != 1){
var caller = g_form.getReference('caller_id');
if (caller.vip=='true') {
g_form.setValue('urgency', '1');
}
}
}
}
}
If you are already using the default client script: Highlight VIP Caller, you can add in the following line to that client script:
g_form.setValue('urgency', '1');
after this line:
if(caller.vip=='true') {
As-is functionality Caution: The customization described here was developed for use in specific ServiceNow instances, and is not supported by ServiceNow Customer Support. This method is provided as-is and should be tested thoroughly before implementation. Post all questions and comments regarding this customization to our community forum.
This is the screen I received after I saved the script. Now could someone please let me know how I can test this script whether it is working or not. I mean, how to create a VIP user and how can I login as him retain my login as admin on the same instance of ServiceNow. Please help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2017 09:05 PM
Harish,
I did the following:
- I was not able to find the option VIP for any user. Hence, I first included VIP in my selected list of columns and then sorted it based on its value which said "true".
- I was able to find only one user. So, I created another user by name: sify.servicenow and marked him as a VIP. Again, here I did not have the option of VIP enabled hence, I did a right click and went to the "Form Layout".
From the Available fields I added the "VIP" onto my Selected list, which then gave me an option of using the check box to select him as a VIP user.
This is the screen where we can see the "VIP" with the check box.
- Now with all your help I was able to check the client script and it worked fine.
- Please, if it is feasible to select multiple correct answers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2017 11:31 PM
Your using onChange client script and I can see type is none there. you need to select the field on which you want to run this.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2017 09:05 PM
Harish,
I did the following:
- I was not able to find the option VIP for any user. Hence, I first included VIP in my selected list of columns and then sorted it based on its value which said "true".
- I was able to find only one user. So, I created another user by name: sify.servicenow and marked him as a VIP. Again, here I did not have the option of VIP enabled hence, I did a right click and went to the "Form Layout".
From the Available fields I added the "VIP" onto my Selected list, which then gave me an option of using the check box to select him as a VIP user.
This is the screen where we can see the "VIP" with the check box.
- Now with all your help I was able to check the client script and it worked fine.
- Please, if it is feasible to select multiple correct answers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2017 11:35 PM
As per the script your using in wiki. type should be caller
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2017 11:37 PM
Hi Nandan,
Please select Type as onChange and Field name as Caller. I think it will work now.
I hope this helps.Please mark correct/helpful based on impact