Notification is not being triggered from scheduled job

Sachin G K1
Kilo Sage

Hi All,

 

I want sent notification to "assigned to" in catalog task, if scheduled date is today and state of catalog task is closed skipped.

SachinGK1_0-1708344963936.png

To achieve this i have created the i have created scheduled job,event and notification as below, but its not working please help!

 

Event Registry:

SachinGK1_1-1708345100147.png

Schedule job:

SachinGK1_2-1708345144979.png

Notification:

SachinGK1_3-1708345187149.png

 

SachinGK1_4-1708345209593.png

 

SachinGK1_5-1708345237767.png

 

Thanks in Advance

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hi @Sachin G K1 

IN order to generate an event you will need the name of the event which you have done in your script, and since your notification is on the catalog task table, you also need to pass on the object of the record for which you are passing on the assigned to and other details.

You can try below syntax:

var scTask = new GlideRecord("sc_task");

scTask= scTask.addEncodedQuery("opened_atONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()");

scTask.query();

while(scTask.next()){

gs.eventQueue("test.eventregistry", scTask);

}

Best Regards
Aman Kumar

View solution in original post

17 REPLIES 17

Aman Kumar S
Kilo Patron

Hi @Sachin G K1 

IN order to generate an event you will need the name of the event which you have done in your script, and since your notification is on the catalog task table, you also need to pass on the object of the record for which you are passing on the assigned to and other details.

You can try below syntax:

var scTask = new GlideRecord("sc_task");

scTask= scTask.addEncodedQuery("opened_atONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()");

scTask.query();

while(scTask.next()){

gs.eventQueue("test.eventregistry", scTask);

}

Best Regards
Aman Kumar

Ignore the scenario i mentioned, lets take simple example, In Scheduled job i will trigger the notification. And notification does't have any condition, it will send notification to admin(me) with subject "HELLO".

Scheduled script:

SachinGK1_0-1708351763939.png

Notification:

SachinGK1_1-1708351796348.pngSachinGK1_2-1708351819078.png

SachinGK1_3-1708351859026.png

How could this also not work

It should work fine, check  if your scheduled job is stuck, you can check against, sys_trigger table.

If you want to validate if your event is getting triggered, you can use background scripts to validate and check against event logs table.

 

Best Regards
Aman Kumar