3 strike automation on incident form

nameisnani
Mega Sage

Hi team ,

 

Issue Description:

We are facing an issue with the Incident Three-Strike Policy automation in ServiceNow.

  • Currently, when the Incident state is set to On Hold and the On Hold Reason is manually updated to Strike 1, Strike 2, or Strike 3, the corresponding notifications are triggered as expected.

  • However, we have also implemented automation where:

    • If the user does not reply within 2 business days, the incident automatically moves to Strike 1.

    • If there’s still no response, it then moves to Strike 2, and so on.

Problem:
When the affected user responds in between (and the incident is moved back to In Progress), we are unable to cancel the previously running Flow Context records. Because of this, the earlier flow continues to execute and sends strike notifications even though the user has already replied.

Current Attempt:
We have tried adding a Cancel Action in the flow to stop the previous execution, but it is not working as expected and is interrupting the flow.

Request for Help:
We need guidance on how to properly cancel the pending/previous Flow Context records once the state changes back to In Progress or when the user replies, so that only the correct strike notifications are triggered.

 

nameisnani_0-1755580924572.png

 

.

nameisnani_1-1755580983871.png

nameisnani_2-1755581024072.png

 

(function execute(inputs, outputs) {
    // ... code ...
    var gr = new GlideRecord('sys_flow_context');
    gr.addQuery('source_record', inputs.parameter_id);
    gr.addEncodedQuery('stateINATING,IN_PROGRESS,QUEUED');
    gr.orderByDesc('sys_created_on');
    gr.query();
    gr.next();
    while(gr.next()) {
        sn_fd.FlowAPI.cancel(gr.getUniqueValue(), 'Flow took too long to execute.');
        outputs.parameter_output = 'Success';
    }
})(inputs, outputs);

 

what was the issue in my configuration , can anyone please help me here .

 

Thanks  

5 REPLIES 5

JackieZhang
Kilo Sage

Actually you can use the scheduled job which running per day to implement it instead of flow.

Just check the state = On Hold and last update date is = 2 business day before. if On Hold Reason is strike 1, then update to strike 2 .... 

 

@JackieZhang 

could you please provide me the steps to achieve my requriment and meets my condition .

Ankur Bawiskar
Tera Patron
Tera Patron

@nameisnani 

I believe it will be somewhat challenging implementing this using flow.

Did you explore scheduled job?

check these

Mastering the Three-Strike Approval Process in ServiceNow: A Step-by-Step Guide 

Low-code/no-code development & implementation of a 3-strike rule 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@nameisnani 

Hope you are doing good.

Did my reply answer your question?

💡 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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader