Firing notification based on event

MWright1
Giga Guru

I registered an event called incident.assign.action triggered by business rule.  That part seems to have worked.

find_real_file.png

 

I then created a notification using this event as trigger.

find_real_file.png

 

But the notification did not fire, and no emails were sent. I am not sure what I am missing.  Please help.

Thanks,

M

1 ACCEPTED SOLUTION

Muhammad Khan
Mega Sage

Hi MWright,

 

I think you have registered an event with name incident.assign.action and triggered it in the business rule, but in notification you are waiting for Incident assigned action event to trigger, which never triggers in this case as per my understanding.

Replace the Event Name in notification with the actual event you are triggering.

Hopefully this will resolve your problem.

 

Regards,

Muhammad Khan

View solution in original post

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi

can you please share a screenshot for the section "Who will receive" as well as the code from your Business Rule.

Kind regards
Maik

Hi Maik,

Thank you for your response.

Notification-Who will receive:

find_real_file.png

 

The business rule did work, otherwise, it would not have created the Event Queue, right?  

In any case, here is my business rule, as requested.:

(function executeRule(current, previous /*null when async*/) {
         var gr = new GlideRecord('sysevent'); 	// We need to query the sysevent table
         gr.addQuery('state', 'ready');   		// We only want the event in the ready state
         gr.addQuery('name', 'incident.assign.action'); 	// Change the event name to the event name you are using
         gr.addQuery('table', 'incident');
         gr.addQuery('instance', current.sys_id + ''); 	// Get the event that has been created for this record

         /* Assuming there is only one ready event active for this record at a time, this can improve performance */
         gr.setLimit(1); 
         gr.deleteMultiple();
	
         //create a new event (reset the time)
         var gdt = new GlideDateTime();
         gdt.addSeconds(300);			//3600 = 1 hour after right now
         gs.eventQueueScheduled('incident.assign.action', current, current.assigned_to, current.assignment_group, gdt);
})(current, previous);

Thanks again,

M

Muhammad Khan
Mega Sage

Hi MWright,

 

I think you have registered an event with name incident.assign.action and triggered it in the business rule, but in notification you are waiting for Incident assigned action event to trigger, which never triggers in this case as per my understanding.

Replace the Event Name in notification with the actual event you are triggering.

Hopefully this will resolve your problem.

 

Regards,

Muhammad Khan

Thank you so much.