Approval Rejection is not working

Community Alums
Not applicable

Hi All, 

 

Having a requirement triggering a multiple approval and after approvals task provision. 

for that we tried using flow designer and workflow in flow designer we were using common subflow for manager approval after that tried to use the workflow for multiple approvals after approvals finally task provision.

 

But in the rejection case the workflow is not working as expected(if all the approvals are rejected it should return reject value. but its getting approved value and triggering task.

 

chanti1_0-1681222016090.png

 

 

Wait Condition :

checkApproval();
function checkApproval() {
var grTask = new GlideRecord('sysapproval_approver');
grTask.addQuery('sysapproval', current.sys_id);
grTask.addQuery('state','requested');
grTask.query();
if(grTask.hasNext()){
answer = false;
}
else{
answer = true;
}
}

 

If condition :

answer = ifScript();
function ifScript() {
var app_count = 0;
var approval = new GlideRecord("sysapproval_approver");
approval.addQuery('sysapproval='+ current.sys_id +'^state=rejected');
approval.query();
var app_count = approval.getRowCount();
if(app_count == 😎 {
return 'yes';
}
else {
return 'no';
}
}

 

Need suggestion. 

 

 

 

5 REPLIES 5

Hi @Community Alums ,
I am facing same issue. Approval is getting approved after rejection