Email Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I have setup an email notification in ServiceNow that is intended to send a message to the end user specific end user and a the person selected in a variable field called
I ran a few tests and checked the email logs, but unfortunately, no emails were sent to end user or the user identified in the preceptor field.
I've attached screenshots of my configuration for your review.
Script being used via Scheduled Jobs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @Swebb ,
Make sure you are only sending two parameters ( I see you are having 3 with null). eventQueue() only supports two parameters for substitution
gs.eventQueue(
'custom.notify.manager.nonemployee',
gr,
gr.request.requested_for.toString(), // end user
gr.variables.preceptor.toString() // preceptor
);
Mark this as helpful and correct if this helps you.
Thanks,
Yaswanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
31m ago
@Swebb, your "IF Condition" is failing... See snip below. (endDateStr === targetDateStr) is returning false. Replace (Strict Equality Operator ===) with (Equality Operator ==) and see if that works???
One side note though, I would suggest to use Flow Designer. You have low code approach for this and you wouldn't need to create events and all this extra configuration. Everything will come in one place handy. Easy to debug and in future if any one wants to modify, debug or make any sort of changes would be easier. (I leave the choice to you.)
Note : As a best practice always have a condition before running any while loop in the scheduled job. If anything goes wrong in your script it will hamper the performance of the system. Have a "try - catch" method and "else" condition whenever using "if" to find out what's running and catch the error. This is to stop any unwanted operation that could run endlessly in unsupervised script execution.
Remember - "Running freeform script can cause system disruption or loss of data."
Hope this helps.
Let me know if it worked.
Regards,
Vikas K