Getting activity log of specific incident through the REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2017 08:06 AM
I would like to know how to get the activity log of a specific incident through the REST API. I have looked at a similar post in this forums and it didn't help me out. I am using Service NOW Helsinki. Please let me know the table name by which I can get the activity logs of a specific incident.
Thanks in advance,
Swamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2017 01:03 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2017 05:42 AM
A little more research showed me that the set field is not a document_id, but a reference to the sys_history_set record, which has the document_id to the record you want. Sorry about that.
You can see this by entering sys_history_set.list in the navigation filter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2017 06:21 AM
I don't have access to view that information on the sys_history_set table. Is there any other way to get activity logs by incident id?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2017 06:23 AM
The only way I see is to get information from sys_history_line which reference sys_history_set, which references the incident record. Without access to those tables, I don't see any other recourse other than to write your own logging mechanism.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2017 07:07 AM
Your query on sys_history_line would be set.document_id=<sys_id>
However, this will only work if someone has recently viewed the record in the system. History Sets/Lines are a cached version of the history of the ticket that gets refreshed based off someone actually accessing the record in the UI. After a period of time this cache is removed. The data in the history set is a combination of records from the sys_audit, sys_journal_field, sys_email tables at least (I'm not sure how it generates relationship added/remove entries, they might be in sys_audit also.
What is your specific requirement? You say the activity log, but are you looking for the changes to specific fields, or everything?