gs.eventQueue() does not trigger email when I pass 'sys_import_set_run' object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 01:20 AM
Hi all,
gs.eventQueue() does not trigger email when I pass 'sys_import_set_run' object. see below script.
var gr = new GlideRecord("sys_import_set_run");
gr.addEncodedQuery("set.table_nameSTARTSWITHu_ib_snow_import");
gr.query();
if(gr.next())
{
gs.eventQueue("ib.test",gr,"","");
gs.print("ok");
}
It trigger the same email when I passed Incident object. see below script.
var gr = new GlideRecord("incident");
gr.addActiveQuery();
gr.query();
if(gr.next())
{
gs.eventQueue("ib.test",gr,"","");
}
What I am missing here please suggest. I want it to trigger for 'sys_import_set_run' object.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 02:02 AM
Hi @Obito ,
Did you checked send to event creator checkbox in notification and also try to put some logs in if loop to check if its entering to loop.
gs.eventQueue('ib.test', gr, gs.getUserID(), gs.getUserName());
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 03:11 AM
It is only triggering when gr is object of an incident table and not for 'sys_import_set_run'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 02:55 AM
Hello @Obito ,
Please give a try to the script below and see how it works for you.
var gr = new GlideRecord("sys_import_set_run");
gr.addEncodedQuery("set.table_nameSTARTSWITHu_ib_snow_import");
gr.query();
if (gr.next()) {
gs.eventQueue("ib.test", gr, "", "");
gs.print("Event queued successfully for sys_import_set_run. Record sys_import_set_run ID: " + gr.getUniqueValue());
} else {
gs.error("No records found for sys_import_set_run");
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 03:09 AM
I tried but it is not triggering