The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Audit State Field

Stan Martin
Kilo Guru

I have a table that extends HR Case.  In that table is of course the State field.  I was successful in turning on auditing for that field and a record is being written to the sys_audit table, but the Old Value and New Value are blank.  Kind of defeats the purpose of auditing.

Any way to get those values to populate?

1 ACCEPTED SOLUTION

Stan Martin
Kilo Guru

Found the answer in this Community Post by @Harshvardhan 

https://community.servicenow.com/community?id=community_question&sys_id=2dbabbdddb820058d58ea345ca961988

It points to KB Article about Application Restricted Caller Access

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0759087

Found 2 records for the Script Include hr_CoreUtils in Requested status.  Moved both of those to Allowed.

The sys_audit table now shows the Old and New Values for the State field.

View solution in original post

8 REPLIES 8

Hi @Stan Martin 

Okay. What about other fields present on your custom table?

Did you try validating if those fields are getting captured or not in the Audit Table?

Because there might be a scenario for state field where setWorkflow(false) is being used when state field is getting updated which may cause it not to log in the Audit table.

Can you confirm if other fields are getting audited or not on the same table?

Please refer the below HI article which talks about the same below:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0832516#audit_sys_audit_history

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Stan Martin
Kilo Guru

Turned on auditing for another field which was a choice field.  No Old Value / New Value information was recorded in the sys_audit table.  A record was added for the updating of that field, so I know auditing is working, but the Old/New values are no being recorded.

 

Hi @Stan Martin 

I learned from one of the expert that for getting the audit work for a field which you want, you need to first enable the auditing for the table and then you can enable it for the Fields you want specifically.

Also, if you do not want it for other fields then you need to switch it off.

Please refer the community thread to which I am referring to:

https://community.servicenow.com/community?id=community_question&sys_id=a6d4ab48db99809014d6fb2439961943

So , Navigate to the Dictionary module and then search for your Table  and open the record with Type as "Collection". For example shown below for Incident table, you need to do it for your Table:

find_real_file.png

Open this record and click on the Audit checkbox as shown below for example:

find_real_file.png

Now for to switch on the auditing for a field, I have already mentioned the steps above, which you can follow.

To disable the auditing for a field, just open the Dictionary entry for that column or field and add the below attribute to the Dictionary:

no_audit

Refer the article below for more info:

https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/security/task/t_ExcludeAFieldFromBeingAudited.html

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0685670

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Stan Martin
Kilo Guru

Found the answer in this Community Post by @Harshvardhan 

https://community.servicenow.com/community?id=community_question&sys_id=2dbabbdddb820058d58ea345ca961988

It points to KB Article about Application Restricted Caller Access

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0759087

Found 2 records for the Script Include hr_CoreUtils in Requested status.  Moved both of those to Allowed.

The sys_audit table now shows the Old and New Values for the State field.