We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to know deleted records

tulasi8
Tera Contributor

Hi Community,

 

As per the client’s requirement, we have disabled several groups and removed the associated users from those groups. I now need to review the records of the users who were removed. Could you please advise on how to check the history for these changes? When we access the audit logs for deleted records, no entries are appearing. 
 
 

Regards,

Tulasi

 
11 REPLIES 11

@tulasi8 

seems some customization is stopping you

you need to debug more.

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

yashkamde
Kilo Sage

Hello @tulasi8 ,

 

The "security constraints" message you are getting means the records exist but are hidden by ACLs. The below script will help you to debug, user confirm whether it's an ACL issue or simply auditing not enabled.
Run this on Scripts - background :

var grTest = new GlideRecord('sys_user_grmember');
    gs.print('Can read sys_user_grmember : ' + grTest.canRead());

    // Look for deleted membership records in audit delete log
    var grAudit = new GlideRecord('sys_audit_delete');
    grAudit.addQuery('tablename', 'sys_user_grmember');
    grAudit.orderByDesc('sys_created_on');
    grAudit.setLimit(5);
    grAudit.query();
    while (grAudit.next()) {
        gs.print('Deleted record sys_id=' + grAudit.documentkey +
                 ' | Deleted by=' + grAudit.sys_created_by +
                 ' | Deleted on=' + grAudit.sys_created_on);
    }

 

If my response helps mark as helpful and accept the solution.