how SYS_history_line table related to Incident table

dalvi195
Kilo Contributor

How can i check specific number of incident into Sys_history_line list

1 ACCEPTED SOLUTION

LaurentChicoine
Tera Guru

You should probably not use sys_history_line as even though it's in the database it's used as a cache table (data is frequently deleted from that table to keep it small). If you want all history you would need to use the sys_audit table.



However both of these table does not have standard reference field that you can Dot-Walk, so in both cases you need to retrieve the sys_id of the corresponding incidents to be able to find the corresponding lines.


View solution in original post

4 REPLIES 4

LaurentChicoine
Tera Guru

You should probably not use sys_history_line as even though it's in the database it's used as a cache table (data is frequently deleted from that table to keep it small). If you want all history you would need to use the sys_audit table.



However both of these table does not have standard reference field that you can Dot-Walk, so in both cases you need to retrieve the sys_id of the corresponding incidents to be able to find the corresponding lines.


shruti_tyagi
ServiceNow Employee
ServiceNow Employee

Set is <sys_id of record you want to search>.



So get sys_id of incident, go to sys_history_line table and search for Set is <sys_id>



Thanks


Shruti


If the reply was informational, please like, mark as helpful or mark as correct!


sergiu_panaite
ServiceNow Employee
ServiceNow Employee

History Line is built based on Audit table for a table. It is built automatically when you view a record/form if it's not there already.


And on top of that is rotated monthly in out of box configuration, so not an accurate resource for reporting:



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


manish123
Giga Guru

Hi All,

I have got similar scenario in which Incident's Opened field in History showing OLD and OLD VALUE as BLANK. And New as correct date time when the ticket has been logged with considering Day light saving however on History its New Value is showing an hour less. For an example, New is showing 2018-05-29 10:13:48, which is displayed on ticket too and New Value is showing 2018-05-29 09:13:48 through History. May I know how New Value has been picked and why the ticket still showing 10:13 as logged not 09:13?

Any help would be much appreciated.