How can i get full incident information using the REST API ?

Paulo Lopes
Kilo Contributor

Hi All,

I'm trying to integrate my external service with ServiceNow and would like to read the complete incidents data through the REST API, but the GET request to the endpoint /now/table/incident only returns the current state of the incidents but what i need are the records of how the state,priority and other fields changed.

I found that the sys_audit and sys_history_line keep information about incident changes, but i don't know which one to use.

How can i get the full evolution data of the incidents ? Is there a single table that keep that information ?

Thanks!

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Potentially you could query metric instance table - if it already holds the data you require, or if you add appropriate metrics.

Otherwise if you require historical record information regarding value changes and times they were changed, then you are going to have to query the history or audit tables.


I would think the most appropriate process would be to push out Incident updates on change,
then when you have this running push or(pull) all historical data from the history or audit tables once only, as querying these tables constantly may result in degraded performance.

Prateek kumar
Mega Sage

Your get request should be on sys_history_line with set= sys_id  of the record

https://YourInstanceName.service-now.com/api/now/table/sys_history_line?set=SysIDOfincident


Please mark my response as correct and helpful if it helped solved your question.
-Thanks