How to Update Catalog Task Variable using REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 12:05 AM
I am trying to update a sc task variable using patch api (/api/now/table/sc_task/<task_sys_id>)
Body-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 12:38 AM
I've never done that myself, but I am sure that you could achieve that with scripted REST APIs. The simple reason is that the variables on a SCTASK record are saved in another table - sc_item_variables_task. That is only the connection, no value there.
Because these variables are not actually connected directly with SCTASK, as they come from parent RITM, you also have to query sc_item_option_mtom to get/update the variable value.
See more of my content here.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 01:13 AM
Hi @rakshith_shetty ,
Please check below link this may help you
https://www.servicenow.com/community/developer-forum/cart-api/m-p/2023814
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak