Create notification triggered by event & scheduled job

Community Alums
Not applicable

Hi,

 

I created a notification which should be sent daily  when knowledge article is in published state .

I created notification,event, scheduled job. Still notification is not getting triggered.

How can I achieve this?

 

thanks in advance!

2 REPLIES 2

Uncle Rob
Kilo Patron

You should post the full script from your scheduled job.

UncleRob_0-1733672559910.png

But based on what I can see... line 1 will probably fire the event, but its not going to send a notification.
The reason is that 'current' doesn't really have a definition in this context.

You're in a Scheduled Script... where is it getting "current" from?
And if current is the record from which a user will be found in which to email, then you're missing everything you need to send the notification.

If you're not a scripter, that's TOTALLY FINE, and Flow Designer can actually do an excellent job of this without code.
First, define your notification, and set the Send When to "Triggered".

Next build a flow like so...
Trigger:   Schedule
1.  Look Up Records (kb_knowldge table, and define your conditions)
2.  For Each of 1
3.  Send Notification (not email!) and pick the notification record you just set to triggered.

Presto!  No code.  No events. 

 

 

Community Alums
Not applicable
var gr = new GlideRecord('kb_knowledge');
gr.addEncodedQuery('kb_knowledge_base=d4fa0752df132100dca6a5f59bf2636e^workflow_state!=cancelled^author=javascript:gs.getUserID()^kb_knowledge_base=d4fa0752df132100dca6a5f59bf2636e^workflow_state=published');
gr.query();
while(gr.next())
{
    gs.eventQueue('kb.noti',gr);

}
 
Can you correct me here?