Send notification to assignee if incident is in active state for 10 days
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 08:40 AM
Hello ,
I want to Send notification to assignee if incident is in active state for 10 days
Thanks
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 10:11 PM - edited 01-10-2024 10:12 PM
Hello @harry24 ,
Try the below code
var incident = new GlideRecord('incident');
incident.addActiveQuery();
incident.query();
while(incident.next()){
var dueDate = new GlideDateTime(incident.opened_at);
var gdt = new GlideDateTime();
var currentDate = gdt.getLocalDate();
var dateDiff =new GlideDateTime.subtract(dueDate, currentDate);
var days= dateDiff.getDayPart()
gs.info(days);
if(days >= 10){
gs.eventQueue('your evnt name',incident);
}
}
Please Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Vaishnavi Shinde