in workflow Need to stop sc task creation after approval or rejected within timeline if userapproved

Purushotham Ga2
Tera Contributor

we created a SR form 'Admin account disabled by AD automation due to inactivity1' and attached the workflow'Account Disabled by AD Automation '.
requirement: we were add a BRANCH activity --> then added 2 activities
like 1 is timer for 15 min-- if manager not approved within timer then it willl create sc task
2 is manager approval -->if manager approved within 15 min then one sc task should create and need to cancel/ignore the timer and should not create sc task.
3 is manager rejected also need to create sctask but after approved or rejected also timer related sc task getting created
----------------------------------
after 15 min, manager should not able to approve that request.

please assist me on this

2 REPLIES 2

Purushotham Ga2
Tera Contributor
 var gr = new GlideRecord('sysapproval_approver');
    gr.addQuery('sysapproval',current.sys_id);
    gr.addQuery('state','requested');
    gr.query();
    while(gr.next())
    {
        gr.state = "skipped";
                gr.comments = "Auto approving the approval after 5 minutes.";
        gr.update();
                workflow.scratchpad.abc=5;
       
    }
 

Purushotham Ga2
Tera Contributor

PurushothamGa2_0-1743131609824.png