How to automate for notifying if a task isopened
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 06:11 AM
I want to send notification mail reminding that a task is opened. The mail should be sent every 6 hours until the task is closed. Please help its urgent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 07:16 AM
Hello @Priyadarshini2 ,
You can use scheduled job, which will run on every 6 hour duration.
1. Create a new event from System Policy > Events > Event Registry. for example (sc_task.not_closed).
2.in schedule job script you can write similar code as given and modify it according to your requirement:
var gr = new GlideRecord('sc_task'); // user your task table
// Query open tasks (tasks that are not closed)
gr.addQuery('state', '!=', 3); // Assuming 3 is the "Closed" state (change as per your instance's configuration)
gr.query();
// Loop through all open tasks
while (gr.next()) {
// Trigger the event if the task is still open
gs.eventQueue('sc_task.not_closed', gr, gr.sys_id, gs.getUserID());
}
Go to System Notification > Notifications.
- Create a New Notification:
- Click New to create a new notification.
- Set the following fields:
- Name:
Task Not Closed Notification
- Table:
sc_task
- Active: Check this box to enable the notification.
- When to send: Set this to trigger when the event is fired.
- Event Name:
sc_task.not_closed
- Event Name:
- Name:
- Set the following fields:
Who will receive: Choose who will receive the notification. This could be the task owner or any other user/group. For instance, use the Assigned to field (Modify as per your requirement).
Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 07:24 AM
why not use flow designer with no-code, low-code solution?
Something like this
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-03-2025 06:23 AM
Hope you are doing good.
Did my reply answer your question?
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