Scheduled job for survey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 01:50 AM
Hello All,
I got an issue with where to start, maybe you will have some idea?
I need to send a reminder only after 3 days when Incident was resolved and only once.
It is important only 1 reminder and after that no other notifications are expected.
I already have notification created "Satisfaction Survey". Event registry as well. Now it is time for scheduled job where I am stuck, would you have any idea how to set up this Scheduled job or maybe there is another option to make this after 3 days sending?
Thank you in advance Guys!
Best regards,
Tina

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 02:08 AM
Hi @Fotina ,
When you resolve an incident, the OOB field resolved_at would be populated.
Based on that date and today's date you can trigger the notification.
var resolvedAt= current.resolved_at;
var date = new GlideDateTime();
var today= new GlideDateTime();
var resolvedDate = date.setDisplayValueInternal(resolvedAt);
var diffSeconds = gs.dateDiff(today.getDisplayValue(), resolvedDate.getDisplayValue(), true);
var days = diffSeconds/(60*60*24)
if(days == 3){
//code here
}
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 06:05 AM
Hello Basheer,
Thank you so much, i created as you said and triggered event however it didnt work, do you have any idea what i missed?
var resolvedAt= current.resolved_at;
var date = new GlideDateTime();
var today= new GlideDateTime();
var resolvedDate = date.setDisplayValueInternal(resolvedAt);
var diffSeconds = gs.dateDiff(today.getDisplayValue(), resolvedDate.getDisplayValue(), true);
var days = diffSeconds/(60*60*24);
if(days == 3)
{
gs.eventQueue('survey.send.reminder.notification', current, gs.getUserID(), gs.getUserName());
}
Thank you,
Fotina