- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2018 08:28 AM
I'm new to servicenow and I've tried to create a service catalog request from ServiceCatalog REST API. Everything worked fine except I would like to change "requested for" for the item request when adding the item to the cart and checkout. I've searched over the communities here and the only close one is this: service catalog - REST api to create request behalf of requester
I understand variables must be associated with the item so they are specific to the item. My question is whether there's actually an API way to set "requested for" info for the requested item through Service Catalog API (addcart, checkout, submit, etc). By that, I meant you don't have to create some variable to some item, just like when I started a fresh instance, enable two-step checkout, then I could submit order for someone.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2018 12:15 AM
Hi
It doesn't look like it is possible using the Service Catalog REST API.
But it is possible using the CartJS api - https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_CJSS-getRequestedFor
var cart = new sn_sc.CartJS();
cart.setRequestedFor("039c516237b1300054b6a3549dbe5dfc")
So you could write your own scripted REST API and route the information through the CartJS api instead. See this for inspiration CartJS API to add multiple item to cart and submit order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2020 06:12 AM
Hello,
Is it possible to achieve such thing now ? (In New York or Orlando)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2023 06:49 AM
I've been digging into this issue and appears it 'should' be supported via the API Documentation
Reference Service Catalog Guide
See: 'sysparm_requested_for'
Sys_id of the user for whom to order the specified item. Located in the User [sys_user] table.
This allows for you to verify if an end user has permissions to be included for the specific catalog item delegated to them.
The only issue is after changing these system properties. I've yet to be able to create an SC Order on behalf of another user. The Delegated users comes back blank, indicating there is no permission issue. The problem appears. The User who authorises the API call is the user the SC 'requested for' field defaults to. So if I set a parameter requested for = Abel but the API was authorised with admin, the new SC request gets created with 'request for' field set for admin. I've also done the same the other way round resulting in abel being set instead.
Unless I'm missing something here. It is set within the documentation and so should be supported?