I have to send reminder email to user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 06:47 AM
Hi,
I have to send reminder email to user when incident has been created and it is unassigned since 7 days.
How we can achieve that, Can anyone please help me on that.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 06:54 AM
You can use the flow designer for this.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 07:00 AM
Hi @niveditakumari,
To send a reminder email to a user when an incident has been created and remains unassigned for 7 days, you can create a scheduled job along with a notification in ServiceNow. Here's a step-by-step guide to achieve this:
Step 1: Create a Scheduled Job
1. Navigate to Scheduled Jobs:
- Go to System Definition> Scheduled Jobs
2. Create a New Scheduled Job:
- Click New to create a new scheduled job
- Choose Automatically run a script of your choosing
3. Configure the Scheduled Job:
- Name: Give it a meaningful name (e.g., "Unassigned Incident Reminder").
- Run: Select the appropriate schedule (e.g., daily).
- Condition: Ensure it runs only for incidents that are unassigned for 7 days.
4. Script:
- Write a script to identify unassigned incidents that are 7 days old and send a reminder email.
Script:
// Find incidents that are unassigned and created more than 7 days ago
var gr = new GlideRecord('incident');
gr.addEncodedQuery('assigned_toISEMPTY^sys_created_onONLast 7 days@javascript:gs.daysAgoStart(7)@javascript:gs.daysAgoEnd(7)');
gr.query();
while (gr.next()) {
// Send a reminder email to the user
gs.eventQueue('incident.unassigned.reminder', gr, gr.opened_by, gs.getUserID());
}
Step 2: Create an Email Notification
1. Navigate to Notifications:
- Go to System Notification > Email > Notifications
2. Create a New Notification:
- Click New to create a new notification.
3. Configure the Notification:
- Name: Name the notification (e.g., "Unassigned Incident Reminder").
- Table: Select the Incident table.
- When to Send: Choose Event is Fired and specify the event you created in the script (`incident.unassigned.reminder`).
- Who Will Receive: Choose the appropriate recipient (e.g., Opened by).
4. Email Content:
- Create the subject and body of the email. Use variables to include dynamic content.
Example Email Content:
Subject: Reminder: Your Incident is Unassigned for 7 Days
Body:
Hello ${opened_by.name},
This is a reminder that your incident (${number}) created on ${sys_created_on} is still unassigned. Please follow up to ensure it is addressed promptly.
Thank you,
IT Support
Step 3: Testing
1. Test the Scheduled Job:
- Manually run the scheduled job to ensure it works as expected.
- Verify that the reminder emails are sent correctly.
2. Monitor and Adjust:
- Monitor the logs and email notifications to ensure everything is working correctly.
- Adjust the script or notification settings as needed.
By following these steps, you can set up a scheduled job and notification in ServiceNow to send reminder emails for unassigned incidents that are older than 7 days.
Thank you, please make helpful if you accept the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2024 10:54 AM
Great information I have a similar issue. I have to send out and email to users whose incidents have not been updated in 3 days and it should check for this everyday (except weekends) what script would I use to achieve this? I already have the email notifications set up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2024 11:34 AM
Hi @MoeG82 & @niveditakumari ,
The technical solution provided by @Yashsvi is good to implement.
I am considering user is caller person on incident form.
But in both the case, the notification (cc: ) should go to either of following team who manage the incidents,
- Associated CI' support manager ( if CI attached to Incident )
- Associated Group Manager ( if any default group assigned, generally HelpDesk group are default )
- HelpDesk L3 Team( or IT Escalation Team )
You can include the user ( caller ) in all such ( above ) emails.
For weekend case, you can write scheduled job for daily trigger and caller the Email notification via event. Within the schedule job code exclude the weekend days.
Refer these thread
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution