- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 08:56 AM
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:
What am I doing wrong?
Thank you in advance,
Laurie
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 01:42 PM
Can you make sure there is no html error on what will it contain section of notification.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 01:42 PM
Can you make sure there is no html error on what will it contain section of notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 02:04 PM
Yes, I think this is the issue. I removed an image, and some other stuff. I will try with plain text only.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 02:12 PM
WHOOOOAAAAAAHHH NELLIE!!! That's Kansas talk for you pointed me in the right direction, and I found the issue! There was a "]" instead of a "}" in the email body. Good heavens!
Thank you sooooo much!
Laurie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 11:26 AM
Hi Laurie,
You should check the Event Log to see if you're event is being triggered. If it is i would check the configuration on your notification.
Some things to check on the notification:
* That is is configured to be triggered for the event
* That it is properly configured to be sent to users / groups. It wouldn't get sent if the individuals defined are incorrect or don't have email defined for them.
Also unless you're using the last 2 parameters for eventQueue() in your notification you can set them to null.
Hope that helps,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 12:13 PM
Hi David,
Yes, I've quadruple checked all of the above suggestions. The event log shows the event was processed, but no email! This is driving me crazy!
Thanks,
Laurie