- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 09:17 PM - edited 11-01-2022 09:22 PM
Currently we have a scheduled script that will send out reminders to users that have their Incident tickets resolved after 5 days, even to users that have their tickets reopened in between, with the condition that these users have not taken the survey
How to add the field reopen_count to my script below, so that any tickets that got resolved and reopened in between, with not receive the surveys? only until the reopened ticket is resolved then only a survey will be triggered to the user
var asint1 = new GlideRecord('asmt_assessment_instance');
asint1.addEncodedQuery("trigger_table=incident^state=wip^ORstate=ready");
asint1.query();
while (asint1.next()) {
var gdt1 = new GlideDateTime(asint1.sys_created_on);
gdt1.addDaysUTC(5); //add 5 days
var dateaftr5 = gdt1.getDate();
dateaftr5 = dateaftr5.toString();
var gdt3 = new GlideDateTime();
var todaydat = gdt3.getDate();
todaydat = todaydat.toString();
}
}
thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2022 05:55 AM
Thank you..I added the query below in italic and it worked..
var asint1 = new GlideRecord('asmt_assessment_instance');
asint1.addEncodedQuery("trigger_table=Incident^state=wip^ORstate=ready^task_id.ref_incident.incident_stateNOT IN1,2,3");
asint1.query();
while (asint1.next()) {
var gdt1 = new GlideDateTime(asint1.sys_created_on);
gdt1.addDaysUTC(5); //add 5 days
var dateaftr5 = gdt1.getDate();
dateaftr5 = dateaftr5.toString();
var gdt3 = new GlideDateTime();
var todaydat = gdt3.getDate();
todaydat = todaydat.toString();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 09:25 PM - edited 11-01-2022 09:28 PM
You can use the following query in your survey trigger script to ignore re-opened incidents
trigger_table=incident^state=wip^ORstate=ready^task_id.ref_incident.reopen_count!=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 09:55 PM
@Sai Kumar B I added the query but it will still trigger surveys for tickets that got resolved earlier but is currently in the Active state
I do not want surveys to be triggered for reopened tickets which are in one of the current states below..
State = Active/In Progress/On Hold
Incident State = Active/In Progress/On Hold
Thank you..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 10:03 PM
@Happy S Can you check the Re-open count value for those incidents?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 12:01 AM
yes I had a few incidents where the state is in progress and reopen count is >1 but still gets the surveys