If the caller of incident is a VIP user then Urgency should be set to High automatically and there should be an alert to the user creating an incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2021 10:35 AM
If the caller of incident is a VIP user then Urgency should be set to High automatically and there should be an alert to the user creating an incident. I wrote the below script for this but its not working . Please suggest
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var user = g_form.getValue('caller_id');
var urg = g_form.getValue('urgency');
If (user.VIP == 'true')
{
g_form.setvalue('urg', '1');
alert('urg is set to high');
}
//Type appropriate comment here, and begin script below
}
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2021 10:46 AM
Hi, Try below
function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } //Type appropriate comment here, and begin script below var cl = g_form.getReference('caller_id',test); function test(cl){ var gr = cl.vip; if(gr=='true'){ g_form.setValue('urgency',1); } } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2021 10:20 PM
Hi Raj ,
Yes its working but can you please explain how the line function test (cl) works ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2022 12:09 AM
//Try this//
function onChange(control, oldValue, newValue, isLoading, isTemplate)
{
if (isLoading || newValue === '')
{
return;
}
//Type appropriate comment here, and begin script below
var user = g_form.getReference('caller_id');
//var urg = g_form.getValue('urgency');
if (user.vip =='true')
{
g_form.setValue('urgency','1');
alert('This is VIP user urgency set to the P1 automatically.');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2022 12:10 AM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var vipalert = g_form.getReference('caller_id', vipfunction);
function vipfunction(vipalert)
{
if (vipalert.vip =='true')
{
g_form.setValue('urgency','1');
alert('This is VIP user urgency set to the P1 automatically');
}
}
}