Using gs.eventQueue in Scheduled Job

ceraulo
Mega Guru

Hello!

I have a scheduled job that triggers an event, which then triggers a notification. This is my scheduled job:

var sysid = gr.getValue('current.variables.contract_support_group');

var gr = new GlideRecord("sc_task");
gr.addEncodedQuery('numberSTARTSWITHSCTASK0000001');
gr.query();

while (gr.next()) {
    gs.eventQueue('event_name', current, 'current.variables.group_reference_variable','current.variables.listcollect_usertable');
}

The Notification (sysevent_email_action) also has the Groups field populated.

When I execute the scheduled job, an email is sent but only to the group in the Groups fields but not to the parameters (parm1, parm2) in the gs.eventQueue.

Please help on what is the cause why this is not working.

Thank you.

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Is this the whole code?

in gs.eventQueue, you need to remove the quotes form 3rd and 4th parameter, essentially it is just passing string instead of variable containing values?

One more thing, how do you have access to current in scheduled job?

Best Regards
Aman Kumar

View solution in original post

4 REPLIES 4

Aman Kumar S
Kilo Patron

Is this the whole code?

in gs.eventQueue, you need to remove the quotes form 3rd and 4th parameter, essentially it is just passing string instead of variable containing values?

One more thing, how do you have access to current in scheduled job?

Best Regards
Aman Kumar

Feel free to mark correct if it resolved your issue 🙂

Best Regards
Aman Kumar

Your questions guided me to the right path in resolving my issue.

I used the variable name used for the GlideRecord and removed the quotes from the 3rd and 4th parameters.

Thanks!

Musab Rasheed
Tera Sage
Tera Sage

Hi,

In notification did you check this yellow checkboxes.?

find_real_file.png

Please hit like and mark my response as correct if that helps
Regards,
Musab