Email Remainders for open cases - how to set it up?

Shubha2
Mega Guru

I need to set up an email remainder for 5 groups for  their respective Open cases. Any suggestions how to achieve this?

Email remainder should have (May be in ONE Email)
     List of all the Open Cases  at the 90 day mark
    
    List of all the open cases - at the 120th day mark
    
    List of all the open cases - at the 150th day mark
    
    List of all the open cases - at the 180th day mark 
    
The Managers should be receiving weekly these remainders. 
These email reminder for any cases not in “closed” or “delete” status
Starting from the created date to 90th day and so on
Need to set this up to 4 different groups (example, HR, Finance, InfoSec..etc)

I read many articles which are similar to this.  Looks like I need to set up an event registry, Notification, schedule job etc. 
But I still don't know how to do this. 
Since, I need to setup for 4 groups and list all the open cases for 4 scenarios, Not too sure, how to calculate this and
Achieve the same? Do I need to setup 5 schedule jobs for 5 groups?  Any help would be greatly appreciated. 


Thank you
Shubha
1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Hi ,

1. Create 4 events (example case.90.day, case.120.day )

2. Create 4 Scheduled jobs / Flow designer (trigger event from job/flow)

3. Create 4 notifications which will be called by events to send notifications

Sample Scheduled job script:

You can test this in background script

var createdDate = '';
var today = new GlideDateTime();
var today_date = today.getDate();
var gr = new GlideRecord('tablename');
gr.addActiveQuery();
gr.addQuery('state', '4');// open case
gr.query();
while (gr.next()) {
createdDate = new GlideDateTime(gr.getValue('sys_created_on')); // created field
createdDate = createdDate.getDate();
var dur = GlideDateTime.subtract(createdDate, today_date).getRoundedDayPart(); // subtract today date - created date
if (dur == 90) { // 90 days
gs.info("INC"+gr.number);

 gs.eventQueue("eventname", gr,"","" ));

}
}

 

Regards
Harish

View solution in original post

5 REPLIES 5

Shubha2
Mega Guru

I would like to further query for individual owners with open cases, and send mails to the individual owners. how do I achieve this in the above script? I created one schedule job, email script, notification but query didnot seem to work, any suggestions Harish?