Three‑strike reminder logic when Incident is On Hold – Awaiting Caller

nameisnani
Mega Sage

Hi Team ,

 

 

Problem Statement

We have implemented a 3‑Strike rule using Flow Designer for Incidents that are put On Hold with reason “Awaiting Caller”.

Expected behavior

  • When the Incident is Resolved or Closed, the strike monitoring must stop immediately.
  • No reminders, comments, or emails should be triggered after resolution.

Actual behavior

  • Even after the Incident is Resolved, the flow continues to execute after the Wait activities.
  • Strike reminders and emails are posted after the incident is already resolved.

Flow Design (High Level)

The flow is triggered on:

  • Record Updated
  • State = On Hold
  • On hold reason = Awaiting Caller

The logic is roughly:

  1. Set strike/order
  2. Wait 2 min
  3. Send 1st reminder
  4. Wait 4 min
  5. Send 2nd reminder
  6. Wait 4 min
  7. Send final reminder + email
  8. Update incident on final strike

There are multiple Wait actions using business hours and holidays.

nameisnani_0-1776241936552.png

nameisnani_1-1776241977590.png

 

steps 1

nameisnani_2-1776242178259.png

nameisnani_3-1776242235474.png

 

nameisnani_4-1776242302611.png

nameisnani_5-1776242370114.png

 

nameisnani_6-1776242453729.png

 

 

 

 

Now in the production we are getting an issue that  even after reslvoing the incident strike sent

 

nameisnani_7-1776242563335.png

 

How to fix this issue - can any one please help me 

 

Business rules 

nameisnani_8-1776242639187.png

nameisnani_9-1776242670003.png

 

 

 

client scirp 

nameisnani_10-1776242737059.png

 

nameisnani_11-1776242778387.pngnameisnani_12-1776242811149.png

 

 

 

 

How should i fix this issue can any one please help me 

 

any scripts i need to update 

 

@Ankur Bawiskar need your support here 

8 REPLIES 8

Ankur Bawiskar
Tera Patron

@nameisnani 

so what debugging did you do in DEV?

Was this not tested properly in DEV or UAT?

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

@Ankur Bawiskar  Thanks for the quick response - we have tested , but don't know suddenly this issue came

Ankur Bawiskar
Tera Patron

@nameisnani 

Can you try this in DEV?

-> When INC is Resolved/Closed, search for Active flow which is running i.e. this 3 strike one and cancel the flow context
something like this in after update BR

var flow = new GlideRecord("sys_flow_context");
flow.addQuery('name', '3 Strike Rule_VS'); // flow name
flow.addQuery('source_record', current.getUniqueValue());
flow.addEncodedQuery('stateINWAITING,IN_PROGRESS,QUEUED');
flow.query();
if (flow.next()) {
    var gpa = new sn_ph.GlideProcessAutomation(flow.getValue('sys_id'));
    if (!gpa.isTerminated()) {
        //cancel the flow and provide the reason
        gpa.cancel('Cancelling this flow as INC is Resolved/Closed');
    }
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

@Ankur Bawiskar  Thanks - i am doing test ing