Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to Send parameter to Notification without hard coding

Deva3
Tera Contributor

Here My requirement is based on variable values it should trigger a event and send the recipient 
Written Business rule on RITM  and sending parm1 and parm2

This is here its hard code , can anyone please help me with this without hard code how we can achieve 

code 

(function executeRule(current, previous /*null when async*/) {
 
// Add your code here
var subapp = current.variables.sub_application;
var Recipient ="";
if(subapp=="Global"){
Recipient="abcd1@xyz.com";
}
else if(subapp=="Safety"){
Recipient="abcd2@xyz.com";
}
else if(subapp=="Portal"){
Recipient="abcd3@xyz,com";
}
 
gs.eventQueue("xyz.search.platform.application",current,Recipient,subapp);
})(current, previous);
5 REPLIES 5

Hello @Deva3 ,

Does my solution, solve your issue, If yes Please accept my solution as accepted and closed  the thread! 

Regards,

Siddhesh