- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 07:17 AM
I need to update a variable on a RITM via the inbound REST API.
I know that the variable values live on the sc_item_option table, which is linked to the sc_req_item table via the sc_item_option_mtom table.
I've been told that I can update the variables via a PUT call to the sc_req_item table if the variable and variable value are passed in the request body, but I haven't been able to get that to work.
Am I right in thinking this wouldn't work, and that any change to a variable value will require a PUT call to the sc_item_option table directly?
I'm seeing conflicting information in the community on what I've found so far, with some people indicating it can be done via a PUT to sc_req_item, but am not seeing the question asker come back and confirm that working for them after the response is given...
Thanks!
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 07:22 AM
Hi,
yes the value for variable are stored in different table and not in sc_req_item table
they are stored in this table "sc_item_option"; I would recommend to use scripted rest api for this instead of using out of the box table API
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 07:22 AM
Hi,
yes the value for variable are stored in different table and not in sc_req_item table
they are stored in this table "sc_item_option"; I would recommend to use scripted rest api for this instead of using out of the box table API
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 07:13 AM
Thank you for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 12:00 AM
Hi,
I have the same requirement. Did you achieve this? were you able to update the RITM variables using the Scripted API. If so could you please share me the sample script? and how you did it.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 07:39 AM
Yes, I was able to complete it. I used a scripted REST endpoint, which in turn used a script include that I created to deal with changing the variables. I believe it took in the name of the variable and the sys_id of the RITM.
I'm not sure that I'm allowed to share the actual code, but this graphic was super helpful when it came to identifying the tables I needed to worry about with the variables:
https://community.servicenow.com/7cf23842db5c5f048c8ef4621f961954.iix