Issue while retrieving records from sys_history_line using Rest API

Prakash10
Giga Contributor

Hi All,

Problem here is, am unable to see records for the sys_history_line table while using in REST API. For some incidents it shows records and for some it is not showing any records.

Request URL: https://<instance>.service-now.com/sys_history_line.do?JSONv2&sysparm_query=set.id=<sys_id>

Method: GET & Status code: 200 Ok

Response:

{
"records": [

]
}

Any help for the above problem is much appreciated. Thank you.

1 ACCEPTED SOLUTION

Prakash10
Giga Contributor

Hi Sanjiv,

Thank you so much for your help. Got a fix for the issue to access the historical ticket data especially to get Work Notes updated time, Ticket assigned time, Ticket On-hold time, Ticket Resume time.

Service-Now Table: sys_audit_list

sysparm query: documentkey (value is the sys id of the INC ticket)

SAMPLE API:

https://<INSTANCE>.service-now.com/sys_audit_list.do?JSONv2&sysparm_query=documentkey=<SYS ID OF THE TICKET>";

NOTE:

ADMIN ACCESS ALONG WITH THE UI ACCESS IS MANDATORY TO ACCESS THE ABOVE TABLE.

View solution in original post

16 REPLIES 16

Sure, Thanks alot for the support and guidance. Much helpful and have gathered good knowledge on Service now with your help and support. Thank you very much once again.

Prakash10
Giga Contributor

Hi Sanjiv,

Thank you so much for your help. Got a fix for the issue to access the historical ticket data especially to get Work Notes updated time, Ticket assigned time, Ticket On-hold time, Ticket Resume time.

Service-Now Table: sys_audit_list

sysparm query: documentkey (value is the sys id of the INC ticket)

SAMPLE API:

https://<INSTANCE>.service-now.com/sys_audit_list.do?JSONv2&sysparm_query=documentkey=<SYS ID OF THE TICKET>";

NOTE:

ADMIN ACCESS ALONG WITH THE UI ACCESS IS MANDATORY TO ACCESS THE ABOVE TABLE.