Events not triggering within a business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 12:26 AM
I've created the below business rule where I'm trying to generate two events. I'm wanting it to trigger when records within the 'x_lbg_group_recert_grp_recertification' get created on the current date:
My two events are:
The records are being created via a Scheduled Job. However what I'm finding that even though there are records that are being created today, it's not generating the two events:
So I was just wondering if anyone knows what I'm doing wrong so that I can generate the two events
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 12:38 AM
Hello @matthew_hughes ,
The above script you are using already has a set of i.e. "globalNotifiedManagers", we can use the same to get the unique Manager's email with few below tweaks:
if (typeof globalNotifiedManagers === 'undefined') {
globalNotifiedManagers = new Set();
}
var recertTasks = fd_data.trigger.current;
var manager = recertTasks.group_manager;
//Changing below condition to check if email address is already in the set and "manager" = true and has email address
if (manager && manager.email && !globalNotifiedManagers.has(manager.email)) {
globalNotifiedManagers.add(manager);
return manager.email;
}
If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 04:04 AM
Any reason not to use the notifications directly?
This will avoid event, flow etc
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 04:07 AM
Hi @Ankur Bawiskar The reason why is because each record has a 'Group Manager' and I want to avoid duplicate emails being to the same person more than once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 04:12 AM
So basically you want 1 email per day to Group manager clubbing the records which got created today?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 04:13 AM
Hi @Ankur Bawiskar The email needs to be sent to the Group Manager on the first day of each quarter.