How to call script include in business rule?

sruthig
Tera Expert

 

How to call script include in the business rule to trigger the notification to users. Please suggest.

 

 

 

 

 

13 REPLIES 13

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

normal syntax and pass the current object

var obj = new ScriptIncludeName().functionName(current);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

should I use like below?

var st = current.getValue("state");

if(st=='3') {

var x= current.vendor_contact.email.toString();

var obj = new ScriptIncludeName().functionName(current);//I updated the script include name and functionname here.

gs.eventqueue("event_name(used in notification)",current, x ,"");

}

else{

var y= current.assigned_to.email.toString();

gs.eventqueue("event_name(used in notification)",current, y ,"");

}

Hi,

Can you share your BR script and why you wish to use script include?

what have you written in script include?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur.

Business Rule

var st = current.getValue("state");

if(st=='3') {

var x= current.vendor_contact.email.toString();

gs.eventqueue("event_name(used in notification)",current, x ,"");

}

else{

var y= current.assigned_to.email.toString();

gs.eventqueue("event_name(used in notification)",current, y ,"");

}