Get Task/RITM details from REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 01:48 AM
Hello,
I'm trying to get details for a TASK/RITM that has variables such as check box, multiple selection buckets etc. through the REST API.
If I try to get just the Task/RITM it does not include the variables, even though they show up in the UI. I searched around a bit and found that I needed to use the "sc_item_option_mtom" and "sc_item_option" tables to get the details. I tried to get the details for one particular Request but see that a few of the results I get from sc_item_option table are just blank where the item_option_new and value should be and do not include
How can I get all the values of the variables through the REST API?
Thanks,
Karan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 06:04 AM
Hello,
I already have that in place and can get the list of options for the RITM back fine but am not able to get the details for the variables/options using the sc_item_option table.
Thanks,
Karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2018 07:55 AM
Hi Karanpreet,
Please refer bellow link that will resolve your query:
https://snprotips.com/blog/2016/7/15/scripted-rest-apis-in-servicenow-how-to-retrieve-catalog-item-variables
Please hit helpful/correct on the impact of the answer.
Warm Regards,
Kiran Salunkhe
Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2018 08:37 AM
It turns out the issue was with the number of items being returned and not the values being returned.
I had a limit in my REST API call for 10 items and it turns out there are quite a log of variables on the form. Once I changed the limit to 100, I could get all the required details.
/api/now/table/sc_item_option_mtom?sysparm_limit=10&sysparm_display_value=true&sysparm_exclude_reference_link=True&sysparm_query=request_item%3D<request item sys_id>&sysparm_fields=sc_item_option
Thanks,
Karan