The CreatorCon Call for Content is officially open! Get started here.

Possible to view the Document Key field (Sys audit table) using the item's name rather than sys_id

ravi_otpp
Tera Expert

While creating a report that references the Sys audit (sys_audit) table with the following parameters:

  • Type: List
  • Group by: Document Key

It seems that the result is being filtered by document key, however, in a sys_id format?

Taking a quick look it seems that there's no way around having it instead show up by the actual item's name and that this field may be hard-coded with the document key?

http://wiki.servicenow.com/index.php?title=Understanding_the_sys_audit_Table#gsc.tab=0

Is this correct? Or is there any way around this?

Thank you.

Ravi

1 ACCEPTED SOLUTION

Patrick Schult2
Giga Guru

That's indeed correct, the document field stores only a sys_id. You can't dot-walk through that, either.



I'd recommend investigating another solution that doesn't involve querying sys_audit - you're risking instance performance by running reports on this table unless you use a pretty specific filter.



What are you trying to get by reporting on audit entries?


View solution in original post

8 REPLIES 8

Patrick Schult2
Giga Guru

That's indeed correct, the document field stores only a sys_id. You can't dot-walk through that, either.



I'd recommend investigating another solution that doesn't involve querying sys_audit - you're risking instance performance by running reports on this table unless you use a pretty specific filter.



What are you trying to get by reporting on audit entries?


Hello,



I have a similar problems. I am querying on this table to extract out the data on the number of times the ticket has been reassigned to another group or another user. the sys_id format does not look good. Please suggest


Again, using sys_audit for any kind of reporting is a not a good idea. It can cause performance issues, and it is not easy for users to understand and write reports on for themselves. Using sys_audit in this manner is a stop-gap to doing it the correct way - with a metric or field on the task.



I would use the OOB field "Reassignment count" for your Incident data if that is what you are referring to. It is also perfectly fine to add a number field to your table to track the number of times the task has changed assignment groups or assignees. You would create a read-only Integer field, and increment it using a Business Rule that runs when assignment group changes (or assignee, depending on what you want it to do).



Metrics can also help you with this kind of reporting, but keep in mind that metrics you set up now are not applied retroactively.


ravi_otpp
Tera Expert

Thank you for confirming, we'll look into this further. We were mainly using this table to report on a delta or difference between the status on items.



Ravi