Journey Accelerator task Due/Overdue Notifications are not triggering
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 07:59 PM
Hi,
I am trying to find the job/script that triggers the OOTB 'JA Task Due' & 'JA Task Overdue' Notifications events-
sn_ja.notification.due
sn_ja.notification.overdue
Is there an OOTB schedule job that triggers these events used in these notifications? I wasn't able to find one.
Thanks in Advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 06:08 AM
Hi,
Did you find the answer, i am also trying to find same thing.
Thanks,
Mohanapriya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 06:25 AM
sn_ja.notification.due - This event triggered from Task due notification flow
sn_ja.notification.overdue - This event triggered from Task overdue notification flow
Please mark my answer is correct if that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 06:22 AM
Initial Answer
Problem Name: No OOTB Scheduled Job for JA Task Due/Overdue Notifications 😊
General proposed solution (≤100 words):
Create a single Scheduled Script Execution in the sn_ja scope that runs daily (e.g. at 2 AM), queries the sn_ja_journey_task table for tasks in pending/in-progress states, and uses gs.eventQueue(...) to fire the built-in sn_ja.notification.due and sn_ja.notification.overdue events based on each task’s due_date ⚙️
Detailed step-by-step proposal (≤250 words):
Navigate: System Definition ➔ Scheduled Script Executions and click New.
Configure header:
Name: JA Task Due/Overdue Notifications
Application: Journey Accelerator (sn_ja)
Run: Daily at 02:00
Script:
(function() { var gr = new GlideRecord('sn_ja_journey_task'); gr.addQuery('state','IN','pending,in_progress'); gr.query(); var todayStart = gs.beginningOfToday(); var todayEnd = gs.endOfToday(); while (gr.next()) { var due = new GlideDateTime(gr.getValue('due_date')); if (due.compareTo(todayStart) >= 0 && due.compareTo(todayEnd) <= 0) { gs.eventQueue('sn_ja.notification.due', gr, gr.sys_id, gr.assigned_to); } else if (due.compareTo(todayStart) < 0) { gs.eventQueue('sn_ja.notification.overdue', gr, gr.sys_id, gr.assigned_to); } } })();
Save 🔄 and activate the job.
Test: Adjust a sample task’s due_date to today/past, wait for the next run, then verify System Logs ➔ Events and email receipts 🧪.
Example solution (≤100 words):
An HR manager (role: sn_ja_manager) in the Employee Center receives a Task Due email when an onboarding “Plan Participant Task” reaches its due date, and a Task Overdue reminder 24 hours after it slips past due. Module: Journey Accelerator 📧👥
Please mark this as the correct answer! ✅
Sources:
Scheduled Script Execution Scripts – ServiceNow Developers: details how to create a scheduled script and use gs.eventQueue() to fire events on records
Notify using Scheduled JOBS in ServiceNow – Kailash Bhange, Community article on registering events and creating scheduled jobs that queue notifications
Analysis of the Initial Answer
Assumption of a custom job: The answer presumes no OOTB scheduled job exists for these events; this is based on the original thread but not explicitly documented. ❗
Schedule timing: The 02:00 AM schedule is a guess; actual run times should match business needs. ⏰
Script scope and performance: Putting all logic in one script is simple but may grow heavy as task volume increases; splitting into two jobs (due vs. overdue) could improve maintainability. 🛠️
Date comparison logic: Using compareTo() on GlideDateTime ensures proper comparison, but edge cases (time zones, record time vs. date-only fields) should be tested. 🌐
Alternative no-code solution: Flow Designer offers “Scheduled Flows” that can perform the same without scripting, which may better align with best practices. 🔄
Final Version
Problem Name: No OOTB Scheduled Job for JA Task Due/Overdue Notifications 🎯
General proposed solution (≤100 words):
Create a Scheduled Script Execution in the sn_ja scope that runs each night, iterates through sn_ja_journey_task records in pending/in-progress states, and uses gs.eventQueue() to fire the built-in sn_ja.notification.due (for today’s due tasks) and sn_ja.notification.overdue (for past-due tasks) events 🚀
Detailed step-by-step proposal (≤250 words):
Go to: System Definition ➔ Scheduled Script Executions, click New.
Set properties:
Name: JA Task Due/Overdue Notifications
Scope: sn_ja
Run: Daily at your preferred hour.
Add this script:
(function() { var gr = new GlideRecord('sn_ja_journey_task'); gr.addQuery('state','IN','pending,in_progress'); gr.query(); var start = gs.beginningOfToday(); var end = gs.endOfToday(); while (gr.next()) { var due = new GlideDateTime(gr.due_date + ' 00:00:00'); if (due.compareTo(start) >= 0 && due.compareTo(end) <= 0) gs.eventQueue('sn_ja.notification.due', gr, gr.sys_id, gr.assigned_to); else if (due.compareTo(start) < 0) gs.eventQueue('sn_ja.notification.overdue', gr, gr.sys_id, gr.assigned_to); } })();
Save and activate the job.
Verify: Set a test task’s due_date to today or yesterday, let the job run, then check System Logs ➔ Events and email inbox for due/overdue notifications.
Alternative: Use a Scheduled Flow in Flow Designer—no scripting required—to query the same table and “Fire Event” actions for each condition.
Example solution:
An HR specialist (sn_ja_hr) gets an “JA Task Due” email when an offboarding checklist item is due today, and an “JA Task Overdue” reminder if not completed by the next day. Module: Journey Accelerator 📑📩
Please mark this as the correct answer! ✅
Sources:
Scheduled Script Execution Scripts – ServiceNow Developers: guidance on building Scheduled Script Executions and using gs.eventQueue()
Notify using Scheduled JOBS in ServiceNow – Kailash Bhange, Community article detailing event registration and scheduled job setup for notifications