How to get the incident history using REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 06:12 AM
I am trying to get the changes of a particular incident that had happened on a particular date from service now incident. I am passing date and the incident number as the query parameter. Is there any REST API that I can use to get it. Or is there any way to get it. I am not looking forward to using SOAP. Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 06:53 AM
Hi Vishi,
Below are the table APIs for History record and History Line item
https://[InstanceName].service-now.com/api/now/table/sys_history_set
https://cert032.service-now.com/api/now/table/sys_history_line
History Line Item stores the updates for the each field in each record.
History Set table links the incident record and line items.
You can explore more on right clicking the form header and show history
Thanks
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 08:44 AM
I get the error 403 (forbidden).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 07:37 AM
If you are interested in a specific kind of change, e.g. change of the incident state - you can configure a metric and then query metric_instance table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 06:15 AM
I had this same issue and, elaborate on Srinivas' post above, here's what I did. In order to pull the history for a task, you can pass the sys_id for that task and match it up with the id field of the sys_history_set table.
Here's a basic example - you just need to substitute the sys_id of your incident:
And a little more complicated example pulling specific fields and filtering out original values (what update!=0 does). Hope this helps!