- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2015 10:59 AM
When using the rest api for incidents, the "comments" journal field always returns an empty string. Setting "sysparm_display_value = true" will output all of the comments in a single string which is not very useful. How do I query the journal table for the comments as separate json objects?
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2016 08:56 AM
Use the rest api for the sys_journal_field table in the same manner you would query the incident table providing the desired criteria. In this case you're looking for the "comments" from an incident record. So you would set the endpoint to point to the sys_journal_field and provide the incident sys_id that you're looking to gather the comments from as well as set to limit the query to the comments field (because you can gather the work_notes as well if desired)
{your instance name}.service-now.com/api/now/table/sys_journal_field?sysparm_query=element=comments^element_id={your incident sys_id goes here}
That should give you a result of the comments from a specific incident each as a separate item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2016 08:56 AM
Use the rest api for the sys_journal_field table in the same manner you would query the incident table providing the desired criteria. In this case you're looking for the "comments" from an incident record. So you would set the endpoint to point to the sys_journal_field and provide the incident sys_id that you're looking to gather the comments from as well as set to limit the query to the comments field (because you can gather the work_notes as well if desired)
{your instance name}.service-now.com/api/now/table/sys_journal_field?sysparm_query=element=comments^element_id={your incident sys_id goes here}
That should give you a result of the comments from a specific incident each as a separate item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2016 02:04 PM
One note, we had to expose the journal table to the rest api, it wasn't allowed by default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2016 10:44 AM
Jesse,
How did you expose the table?
Thanks,
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 11:55 AM
Please elaborate on how you exposed it?
