Rest call to get associated catalog variables for a Request Item

Patrick Delaney
Kilo Contributor

I am looking for a way to verify the content of a catalog variable table that is associated with a Request item. I;'m new to ServiceNow and REST. I am using Postman to query ServiceNow and I am using the following command.  I am not getting the data I was expecting.

 

GET https://xxhelpdesk.service-now.com/api/now/table/sc_item_option_mtom?sysparm_query=number%3DRITM0170655

Im not sure I have syntax correct for the second part of the command.

 

It's my understanding that the sc_item_optio_mtom is the variables table and I was hoping that:

?sysparm_query=number%3DRITM0170655  would pull the catalog variables for the RITM0170655.

But it returns 140,000 lines, that is not what I am looking for.

Any thoughts?

Thanks

5 REPLIES 5

Prateek kumar
Mega Sage

Change your get query to 

https://YourInstanceName.service-now.com/api/now/table/sc_item_option_mtom?request_item=RITM0070020


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

I tired that and it didn't return what I expected. what I really want it the catalog variables that are associated with that RITM?

mikecole
Tera Contributor

Tim Woodruff wrote the article "ServiceNow Scripted REST APIs & Retrieving Catalog Item Variables" back on July 15, 2016 that might do the trick for you with a scripted REST API.  

https://snprotips.com/blog/2016/7/15/scripted-rest-apis-in-servicenow-how-to-retrieve-catalog-item-variables

 

Alikutty A
Tera Sage

Hello Patrick,

Your REST query should be fired on this endpoint

https://instance_name.service-now.com/api/now/table/sc_item_option_mtom?sysparm_query=request_item.number=RITM0010038

The filter should be

sysparm_query=request_item.number=RITM0010038

 

Thanks!