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-17-2017 05:30 AM
Use the navigation filter at the top left and type
sys_history_line.list
Once on the list, you can use Configure> Dictionary to see the table structure. The "set" field is your reference to which incident you want. You'll need to specify which set you want on your URL something like
https://INSTANCENAME.service-now.com/...?sysparm_query=set=SYS_ID_OF_INCIDENT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2017 12:53 PM
I tried querying an active incident in service now by the sys_id and no results were returned. I am able to get a lot of records through the query but I am having a hard time understanding the response results. I just want to see the activity log of an incident in Service Now. Unfortunately, I do not have admin rights to service now as I am consuming the client api to get some information.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2017 02:46 PM
I believe you need to do this in two steps. Step 1 is get the sys_id of the incident you want. If you don't already have it, then you need to send a REST GET to the table API. If you have something like the number (e.g. INC0010004) you can do a sysparm_query=number=INC0010004 and it will return the sys_id in the response.
Once you have that, make your second call to the sys_history_line table with something like sysparm_query=set=(INCIDENT_SYS_ID) - sys_id from the other query.
Hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2017 07:23 AM
ok for the first step, can you tell me from which table I can get the sys_id for the incident that I want to query?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2017 12:53 PM
I got the sys id of the incident record and tried to query the sys_history_line table using that sys_id and no results were returned.