How to modify a variable in RITM using REST API?

Apex Predator
Kilo Expert

I have a catalog item with a few variables. I am able to create RITM's for this. But I want to modify an RITM at a later time i.e I want to update one of the variable's value of the RITM using REST API. How can I achieve this? Is there an out of the box API to do this?
Thank you

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Apex Predator 

I have shared solution in this 1st link

Update requested item variables using REST API

How should a third part app update existing Request Item variables via API?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Allen Andreas
Administrator
Administrator

Hi,

Please take a look at the ServiceNow Rest API Explorer.

https://developer.servicenow.com/dev.do#!/learn/learning-plans/orlando/technology_partner_program/ap...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

I already went through this. I am able to query an RITM with variables as parameters(GET) but I not able to figure out how to update a particular variable of an RITM using PUT or PATCH.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

You cannot update variables directly using OOB API unless you use Table API on this table "sc_item_option_mtom"

Catalog variable values are stores in the table Variable Ownership [sc_item_option_mtom] and sc_item_option.

I would suggest to create custom Scripted REST API which accepts RITM number, Variable Name and the Variable value to be updated

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@Apex Predator 

I have shared solution in this 1st link

Update requested item variables using REST API

How should a third part app update existing Request Item variables via API?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader