eventQueue not firing email - using nowDateTime() Method - Change Managment

Laurie Marlowe1
Kilo Sage

Hello,

We have a requirement to send an email to the Change Management group if the Planned Start time is 8 hours in the future from the current time.

I created an onBefore business rule.  Here is my code:

(function executeRule(current, previous /*null when async*/) {

	var gdt = new GlideDateTime(gs.nowDateTime()); //get the current date and time from the server
	gdt.addSeconds(28800); //add 8hours in milliseconds because this is how the server thinks
	gs.addInfoMessage(gdt.getValue());  //this is working
	gs.addInfoMessage(gs.nowDateTime()); //this is working
	if(current.start_date < gdt.getValue()){ //gdt value is 8 hours in the future
		
		gs.addInfoMessage('A notification has been sent to the Change Manager as this may be considered as an expedited change.'); //this is working
		gs.eventQueue('change.expedited', gdt, gs.getUserID(), gs.getUserName()); //email not sent
		
	}
	

})(current, previous);

 

The gs.eventQueue is not firing the change.expedited event.

The event is registered.

The email is set to:

find_real_file.png

 

find_real_file.png

What am I doing wrong?

Thank you in advance,

Laurie

 

1 ACCEPTED SOLUTION

Can you make sure there is no html error on what will it contain section of notification.

View solution in original post

21 REPLIES 21

If your seeing the event get generated in System Policy>Events>Event Log then your BR is properly generating the event.  I would think it would be a configuration issue on the notification, but looking at your screenshots i don't see anything that sticks out.

If you're using a mail script for any of the content i would try just adding plain text to rule out an issue with the scripts.  You could also check that the weight for the notification is 0.

Manikandan T
Giga Contributor

Hi Laurie Marlow,

I have seen the issue which your facing it .Check the code in the if above add it while condition and then add the if which you mentioned and put log on below while condition and if condition you are getting or not .

Try this ..

If it is correct accept the solution