Sending notification when it is not updated for 3 days after it is assigned

vivek110
Tera Contributor

Hi All,
We have a requirement to send a notification to assignee manager when the incident is not updated for 3 days after it is assigned to a particular  persona.

Can you help me to get this requirement done. Any inputs would be appreciated.

Regards,
Hemanth

4 REPLIES 4

matildasand
Tera Contributor

Hi, 


You could create a scheduled job that looks at the incident table and look at all records and send a notification for those that are not updated in 3 days then trigger and event which triggers a notification.

Maybe also include that the incidents active in the query and not the ones closed as well though. 




// Create a GlideRecord object for Incident table
var incidentGR = new GlideRecord('incident');

// Set the filter to find incidents assigned but not updated in the last 3 days
incidentGR.addQuery('assigned_to', '!=', ''); // Incident must be assigned
incidentGR.addQuery('sys_updated_on', '<=', gs.daysAgo(3)); // Incident not updated in the last 3 days
incidentGR.addQuery('active', true); // Only active incidents
incidentGR.query();

while (incidentGR.next()) {
    // Get the assignee's manager
    var assignee = incidentGR.assigned_to;
    var manager = assignee.manager;

    if (manager) {
        // Trigger the custom event using gs.eventQueue
        gs.eventQueue('incident_not_updated_3_days', incidentGR, assignee.name, manager.email);
    }
}

 

Ankur Bawiskar
Tera Patron
Tera Patron

@vivek110 

either use daily scheduled job or flow for this

check these links and enhance as per your requirement

Need help on getting tickets not updated for 5 business days 

Send email if record not updated for 14 days 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@vivek110 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Priyankagupta
Giga Guru

If the manager of the 'Assigned To' should be notified when the incident has not been updated for the past 3 days.

 

Create a notification and trigger it through an event. The event should be called within a scheduled job.

 

The scheduled job will run daily on the incident table, triggering the event when the incident has not been updated for 3 days, and the 'Assigned To' field is not empty.

 

The notification recipients should include the manager of the assigned user (assigned_to.manager).