I have to send reminder email to user.

niveditakumari
Mega Sage

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 

 

 

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @niveditakumari 

 

You can use the flow designer for this.

 

https://www.servicenow.com/community/developer-forum/how-to-send-email-reminder-for-7-days/m-p/26394...

 

*************************************************************************************************************
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]

****************************************************************************************************************

Yashsvi
Kilo Sage

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

MoeG82
Tera Contributor

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.

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. 

 

 

@MoeG82 

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

https://www.servicenow.com/community/developer-forum/exclude-weekends-and-holidays-from-scheduled-jo...

 

https://www.servicenow.com/community/itsm-forum/how-to-run-a-scheduled-job-quot-daily-quot-but-exclu...

 

https://www.servicenow.com/community/developer-forum/excluding-the-weekends-in-schedule-job/m-p/1511...

 

https://www.servicenow.com/community/developer-forum/schedule-jobs-to-exclude-weekends-amp-also-holi...

 

-Thanks,

AshishKM

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution