- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2015 02:16 AM
Hi,
I want to get all comments (Additional Comments field on UI) of specific incident using rest api.
Which rest API should I use?
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 06:39 AM
Hi Pooja,
If you don't want to split the string and you need to use the Table API then the best way to get the comments in a list is to make a call on the sys_journal_field passing in sysparm_query with the element_id which is the specific incident sys_id. And if you only want comments and not work notes pass in the element being "comments".
For example:
//<your instance name>.service-now.com/api/now/table/sys_journal_field?sysparm_query=element_id=d71f7935c0a8016700802b64c67c11c6^element=comments
That would return a response with each comment as its own item.
If you want work notes just change the element to be work_notes. If you want both work notes and comments just give an element_id.
I hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2015 10:59 PM
After using this API it is giving all comments in string and not in JSON
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2015 05:53 AM
Hi Pooja,
You can get the same using JSONv2 like the one below:
<instance_name>/tablename_list.do?JSONv2&sysparm_sys_id=<SYS_ID of the incident>
This will return the json object with all fields.
and iterate through tehe json response to get the required fields.
Regards,
Avinash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2015 11:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2015 11:14 PM
Hi Avinash Kumar/kalai,
We wont get the value for comments since it's getting stored in some other table.
Thanks,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2015 11:27 PM
Hi Alex
So do we have any way to get comments in List? Or it will give in string only?