Approval is getting cancelled after rejecting

lakng
Tera Contributor

After rejecting the approval the "sysapproval_approver", request is getting cancelled instead Rejecting.

i have set run script activity in the workflow if the approval is rejected.

var c_task = new GlideRecord('sysapproval_approver');
c_task.addQuery('approver', current.sys_id);
c_task.query();
c_task.state="rejected";
c_task.update();

correct the script if am wrong any where?

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Is the current Approval record getting cancelled which was rejected or the other approval records for the same RITM or table?

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

according to the workflow, only one approval is triggering.

i that user rejects the approval, the approval is setting as cancelled instead of rejecting.

find_real_file.pngso i have created runscript activity which will set the state of the sysapproval_approver to  reject after rejecting.

but it is not happening.

and when you look in to the activities tab, it was rejected and then went to cancelled 

find_real_file.png

Hi,

 

It seems there is another Business rule that runs after update which changes the State for Approval table. Look for Business rules on Approval table that updates the state.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.