Approval records disappear, if you remove approvers with a slushbucket??!!

Andrew Pishchul
Giga Expert

There is a list of approvers on a change request form, which can be manually edited with a slushbucket. When you remove an approver from the list, the approval record (sysapproval_approver table) just disappears, even if it was approved/rejected before!!

...Is there any way how to find those records (removed approvals) in the system?

9 REPLIES 9

CapaJC
ServiceNow Employee
ServiceNow Employee

Unfortunately no. Deletion of sysapproval_approver records is not audited in such a way that they show up in the Restore Deleted Records module.

The following query against sys_audit will show you the sys_id values of those sysapproval_approver records that were deleted (caution! if your instance is large, the query might time out - arbitrary queries against sys_audit are discouraged):
sys_audit_list.do?sysparm_query=tablename=sysapproval_approver^fieldname=DELETED

The sys_ids of the deleted records would in the Document Key field.

If you never wanted those to get deleted, I think a Delete ACL on sysapproval_approver might work, though I've never tried it.


CapaJC
ServiceNow Employee
ServiceNow Employee

I just tested, modifying the script on the existing Delete ACL on sysapproval_approver. I changed the script to "false;" (without quotes), and unchecked the "Admin overrides" field.

I was able to add approvers using the slushbucket, but I was unable to remove them. The slushbucket let me remove them, but the deletes didn't happen.


That's a great idea to use 'delete' ACL to restrict users to remove approvers...I just totally forgot about that type of ACLs, Thanks!


CapaJC
ServiceNow Employee
ServiceNow Employee

And in the ACL, before the script returns "false;", you could maybe do a gs.addInfoMessage("Access denied to delete approval record"); so the user isn't confused as to why he/she removed them in the slushbucket, but nothing happened.