sysparm_requested_for isn't working

Diogo Soares
Tera Expert

Hello Community!

 

I'm using the API /api/sn_sc/servicecatalog/items/{sys_id}/order_now to create a request and its ritm from a 3rd party tool.

 

I used the following body

{
    "sysparm_quantity": 1,
    "sysparm_requested_for": "ashley.parker",
    "variables": {
        "equipment": "laptop"
    }
}
 
And the RITM was created successfuly.
DiogoSoares_0-1733949781461.png

Usually the requested_for had to be filled with sys_id but turns out that with user ID it works fine as well.

 

My issue is that I can do the above in a PD instance but not in my customer instance. Here it works accepting only a sys_id value in sysparm_requested_for, not a user ID.

 

Does anyone know how that works? Is there a business rule doing the job? Is it a script include?

 

Thanks!

1 ACCEPTED SOLUTION

Hello Danny!

I didn't try your suggestion but I found this article regarding the API I referenced before:

POST /sn_sc/servicecatalog/items/{sys_id}/order_now - Service Catalog API

 

It talks about 2 sys properties that solved the problem.

sysparm_requested_for

Sys_id of the user for whom to order the specified item. Located in the User [sys_user] table.
The settings of the glide.sc.req_for.roles and glide.sc.req_for.roles.default properties determine the level at which a user can request items.
If a value is specified in the glide.sc.req_for.roles property, the system checks if the user has the specified role to request information of other users.
If the glide.sc.req_for.roles property value is empty and the glide.sc.req_for.roles.default property value is deny, no user can request items for other users.
If the glide.sc.req_for.roles property value is empty and the glide.sc.req_for.roles.default property value is allow, any user can request items for other users.

View solution in original post

2 REPLIES 2

Danny Sun
Tera Guru

Hello,

 

If you want to use a user ID, maybe you can try adding this sysparm_input_display_value = true to the parameter:

 

/api/sn_sc/servicecatalog/items/{sys_id}/order_now?sysparm_input_display_value=true

 

 

 

I must fill with the sys_id in my PD instance, but when I add this parameter, user ID works fine.

 

Best Regards,

Danny

 

Hello Danny!

I didn't try your suggestion but I found this article regarding the API I referenced before:

POST /sn_sc/servicecatalog/items/{sys_id}/order_now - Service Catalog API

 

It talks about 2 sys properties that solved the problem.

sysparm_requested_for

Sys_id of the user for whom to order the specified item. Located in the User [sys_user] table.
The settings of the glide.sc.req_for.roles and glide.sc.req_for.roles.default properties determine the level at which a user can request items.
If a value is specified in the glide.sc.req_for.roles property, the system checks if the user has the specified role to request information of other users.
If the glide.sc.req_for.roles property value is empty and the glide.sc.req_for.roles.default property value is deny, no user can request items for other users.
If the glide.sc.req_for.roles property value is empty and the glide.sc.req_for.roles.default property value is allow, any user can request items for other users.