gs.eventqueue not taking glide record object

Nayana N
Tera Contributor

I am trying to send email notification. I have created an event. I am calling my event through scheduled job. I am trying to pass the gliderecord object, but the event log is showing as error. This is my code:

 
var target = new GlideRecord('u_public_cloud_extract_vw');
target.addEncodedQuery('vul_u_account_l3_ownerLIKESharon Bottome^vul_u_vulnerability_severity_status=Critical^vul_u_vpr_score>=9.5^vul_u_owner_email=shantini.vandichalil@hp.com');
target.query();
while (target.next()) {
gs.eventQueue("vul.email.notification.eis",target,target.vul_u_owner_email,'');
}
 
Any suggestions please...
2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

Can you share the error which you are getting?

Amit Gujarathi
Giga Sage
Giga Sage

Hi @Nayana N ,
I trust you are doing great.
Please find below comments .

  1. The variable declaration for target is missing a keyword (var or let or const) before it.
  2. In the gs.eventQueue() function, you are passing target as the second argument, which should be a string value representing the name of the event to be triggered.
  3. You are passing an empty string as the fourth argument in gs.eventQueue(), which should be a valid JSON object that contains any additional data to be passed along with the event.

 

var target = new GlideRecord('u_public_cloud_extract_vw');
target.addEncodedQuery('vul_u_account_l3_ownerLIKESharon Bottome^vul_u_vulnerability_severity_status=Critical^vul_u_vpr_score>=9.5^vul_u_owner_email=shantini.vandichalil@hp.com');
target.query();

while (target.next()) {
  gs.eventQueue("vul.email.notification.eis", null, target.vul_u_owner_email, {});
}

 

 

Please mark the answer correct if its of any help.

 

Regards,

Amit Gujarathi


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi