SOW - Follow Up Field - Incident

keerthana10
Tera Contributor

Hi experts, 

I need to create the reminder automatically  based on 'follow-up' field for the hour before notification to Assigned to user.Also Reminders is need to present in the list view of SOW. Also we need to enable reminder to be triggered in platform, it should be listed in upcoming task in the homepage of SOW. We should also enable trigger to MS Teams.

 

How to achieve this  , please help on this , Thanks

5 REPLIES 5

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @keerthana10 

 

I need to create the reminder automatically  based on 'follow-up' field for the hour before notification to Assigned to user.

 

Atul: You can use the Flow Designer, or just keep using the method (Reminder table) you were using before.

 

 

Also Reminders is need to present in the list view of SOW. Also we need to enable reminder to be triggered in platform, it should be listed in upcoming task in the homepage of SOW.

Atul: Can you elaborate more on this

 

We should also enable trigger to MS Teams.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG  for this requirement , i am using 

event

scheduled job

Notification. 

Based on the requirement i got notification , but that reminder record does not created in that particular incident record. 

 

Script: 

(function() {
    var now = new GlideDateTime();
    var oneHourLater = new GlideDateTime();
    oneHourLater.addSeconds(3600); // Add 1 hour

    var gr = new GlideRecord('incident'); // Replace with your table if needed
    gr.addNotNullQuery('follow_up');
    gr.addNotNullQuery('assigned_to');
    gr.addQuery('follow_up', '>=', now);
    gr.addQuery('follow_up', '<=', oneHourLater);
    gr.query();

    while (gr.next()) {
        // Optional: Skip if a reminder already exists
        var reminderCheck = new GlideRecord('reminder');
        reminderCheck.addQuery('table', 'incident');
        reminderCheck.addQuery('record', gr.sys_id);
        reminderCheck.query();

        if (!reminderCheck.hasNext()) {
           
            gs.eventQueue('incident.followup.reminder', gr, gr.sys_id, gr.assigned_to);

            // 📝 Create Reminder Record (for UI visibility)
            var reminder = new GlideRecord('reminder');
            reminder.initialize();
            reminder.name = "Follow-up Reminder for " + gr.number;
            reminder.table = "incident";
            reminder.record = gr.sys_id;
            reminder.user = gr.assigned_to;
            reminder.message = "Follow-up is due at " + gr.follow_up.getDisplayValue();

            var reminderTime = new GlideDateTime(gr.follow_up);
            reminderTime.subtract(3600); // subtract 1 hour
            reminder.reminder_time = reminderTime;

            reminder.insert();
        }
    }
})();
 
Please help me on this, thanks.

Sorry mate, i hv  no idea about code

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Mark Manders
Mega Patron

What do you already have?

What did you already try and didn't work? Your 'also...', 'also...', 'also...' sounds more like you are asking the Community to do your work for you.
How is this setup? Are agents putting in a date/time on the ticket and you need that to be set? If the reminder is send (just use a simple flow that waits until an hour before that date/time if that is what you have), why do you need the reminder in the list? You want the follow up to show, so they know that, right? 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark