Incident onhold three strike policy

rajeshKongamudi
Tera Contributor

Hi everyone, we are facing issue on three strike automation policy using flow designer, We have implemented one cancel flow activity which it is not working as expected after we upgrade to Washington DC, we are following the end flow activity as well after for every on hold reason changes from Strike1,2,3.....Here our main problem is when we initiate the incident on hold reason to strike 1 and the time as we kept 5 min as wait condition after 3 minutes user has replied and it got in progressed back and we replied back with strike 1 again (assume I have raised incident strike 1 at 8:30 after 4 min it got in progress and one more new context flow will be added and now 2 flows are working parallelly now I have raised at 8:36 but both are in same stages and have taken the old flow i.e. 8:30 and send the notification for strike 2 with in 1 minute instead should wait for 4 minutes for strike2)

 

IMP:  Here Cancel activity was not working properly it should cancel the previous context flow if new incident was raised to on hold again one more context flow should trigger and last one should cancel as per the script, can someone please help us to trigger the cancel activity should trigger when new flow attached previous should cancelled Here is my script and flows as shown here. Please do the needful.

 

Cancel Script:

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

rajeshKongamudi_0-1713977850099.png

 

rajeshKongamudi_1-1713977896319.pngrajeshKongamudi_2-1713977927119.pngrajeshKongamudi_3-1713977945346.pngrajeshKongamudi_4-1713977975754.pngrajeshKongamudi_5-1713977995807.png

 

 

0 REPLIES 0