Send notification to assignee if incident is in active state for 10 days

harry24
Tera Contributor

Hello , 

I want to Send notification to assignee if incident is in active state for 10 days 

 

Thanks 

5 REPLIES 5

SanjivMeher
Kilo Patron
Kilo Patron

You can probably use a flow designer for this.....trigger it when the state changes to active and then add a Timer of 10 days. The timer will moves to next step after 10 days, where you check if state is still active, then trigger the notification to the assignee.


Please mark this response as correct or helpful if it assisted you with your question.

Sandeep Rajput
Tera Patron
Tera Patron

@harry24 You can write a scripted scheduled job which will run daily and fetch those incidents which were created before 10 days and are still in active state. Trigger the notification via gs.eventQuery('event name', gr, 'param1','param2');

Can you please help me with the script

Jayant_M
Kilo Sage

Hi Harry,

Try using below script and modify the query according to your script

 

var iInc = new GlideRecord('incident');
iInc.addQuery('active', true);
iInc.query();
while (iInc.next());
dueDate = current.created;
curDate.addDaysLocalTime(-10);
var tenDays = curDate.getLocalDate();
if (tenDays == dueDate) {
        gs.eventQueue('event name', current);
    }
 
Please mark my response helpful if it resolves your issue