Find whether or not INC0000019 has a VIP as its caller ?

Vivek Verma
Mega Sage
Mega Sage

Need Full Script !

1 ACCEPTED SOLUTION

nayanawadhiya1
Kilo Sage

Run this code in Background Script  -

var inc = new GlideRecord('incident');
inc.addQuery('number','INC0000019');
inc.query();
if(inc.next()){
if(inc.caller_id.vip == true)
{
gs.print("Caller is VIP");
}
else{
gs.print("Caller is not VIP");
}
}

View solution in original post

3 REPLIES 3

nayanawadhiya1
Kilo Sage

Run this code in Background Script  -

var inc = new GlideRecord('incident');
inc.addQuery('number','INC0000019');
inc.query();
if(inc.next()){
if(inc.caller_id.vip == true)
{
gs.print("Caller is VIP");
}
else{
gs.print("Caller is not VIP");
}
}

RatneshTSN
Giga Guru

VIP is field on user table < sys_user>. If for particular user it can be set it true

& Caller <User>  for this incident having VIP field value true.

So in business rule, if need to show info message once record is updated/inserted

 

You can write below code

If checking via Business rule on incident number

if(current.caller_id.vip == true)
  gs.addInfoMessage(current.caller_id.name +" is VIP caller);

 

 

Hi Vivek,

If you want just to check this particular Incident Record, you can go ahead with the Background Script, as suggested by nayan_awadhiya. 

But in case, you want to perform a check on each incident for a VIP caller, and want to Highlight that or want to perform some other actions over it, you can make use of 1 Out Of The Box On Change Client Script, Highlight VIP Caller. 

You can either copy this code or make changes in it, to enhance it as per your Requirement.

Please mark my answer as Correct/Helpful in case it helped.

 

Regards,
Vishrut
find_real_file.png