- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2018 02:54 PM
Hello guys,
I need the history of changes for the Assigned to Field, I am working in the sandbox and enabling auditing for the incident table as suggested here:
https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/administer/security/task/t_EnableAuditingForATable.html
Yields nothing when I make the API call. Querying sys_dictionary , sys_audit, sys_history_line or sys_history does not work either. I dont know what to do, im using python. Here is one example, the requests that come back are empty or invalid, how else can I do this? Is there a way to get the " Field changes " table? thank you!
# Set the request parameters
url = env + 'api/now/table/sys_audit/' + sys_id
# Set proper headers
headers = {"Content-Type":"application/json","Accept":"application/json"}
# Do the HTTP request
response = requests.get(url, auth=(user, pwd), headers=headers ,data="{\"fieldname\":\"assigned_to\"}")
# Check for HTTP codes other than 200
if response.status_code != 200:
print('Status:', response.status_code, 'Headers:', response.headers, 'Error Response:',response.json())
exit()
# Decode the JSON response into a dictionary and use the data
data = response.json()
return data
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2018 01:29 PM
Hi Mario,
Could you set my response to correct if this query retrieved the correct details for you?
Cheers,
Steve

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2018 03:23 PM
Can you change the 2nd line to below and try
url = env + 'api/now/table/sys_audit/?sysparm_query=documentkey=' + sys_id
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2018 11:03 PM
If it worked kindly mark my response correct
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2018 07:28 AM
What goes in sysparm_query=documentkey , Whats the document key?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2018 10:06 AM
documentkey stores the sysid of the incident
Please mark this response as correct or helpful if it assisted you with your question.