Notification to Assignee to
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 10:29 PM
Hi All,
We have one requirement to send the notification to "Assigned to" if the incident is not updated for more than 6 hrs since the time it is assigned to him.
Can you help me to resolve this?
I have tried scheduled job and also Flow designer but not able to get this.
Regards,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 11:00 PM - edited 12-30-2024 11:10 PM
Hello @vivek110
You can achieve this requirement by creating a scheduled job that checks for incidents not updated within the specified time frame and then sends a notification. Here's a step-by-step guide to help you set this up:
1) Create a Scheduled Job:
- Navigate to System Definition > Scheduled Jobs.
- Click on New to create a new scheduled job.
- Set the Run field to a suitable interval (e.g., every hour).
2) Define the Script:
In the script section, write a script to find incidents that have not been updated for more than 6 hours. Here's an example script:
var gr = new GlideRecord('incident');
gr.addQuery('state', '!=', 'Closed'); // Ensure the incident is not closed
gr.addQuery('sys_updated_on', '<=', gs.minutesAgo(360)); // 360 minutes = 6 hours
gr.query();
while (gr.next()) {
// Check if the incident has been assigned and not updated by the assigned person
if (gr.assigned_to && gr.sys_updated_by != gr.assigned_to) {
// Send notification
gs.eventQueue('incident.inactivity.notification', gr, gr.assigned_to, gs.getUserID());
}
}
3) Create a Notification:
- Navigate to System Notification > Email > Notifications.
- Click on New to create a new notification.
- Set the When to send field to the custom event you defined in the script (e.g., incident.inactivity.notification).
- Define the Who will receive field to Assigned to.
- Customize the What it will contain section to include relevant information about the incident.
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 05:28 AM
I have tried your code but it is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 11:06 PM
Hi @vivek110 ,
Can please provide snap of action and condition in flow designer, or we can acheive the these requirement by adding "Look up record" action on incident table with condition:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 01:27 AM
you can use flow designer for this
Something like this but please enhance it as per your requirement
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