Service Catalog REST API - How to Pass Requested For Field - Ebonding

patbishop
Mega Guru

I am attempting to use the Service Catalog - Add to Cart, and Checkout APIs to ebond two instances.  Essentially, a user will fill out a Service Catalog Request, it gets submitted into one instance (REQ and RITM) Then if the RITM needs ebonded, an Assignment Group is triggered to initiate the ebond, builds a JSON file and then runs the Add to Cart and Checkout APIs.

This is all working, except I cannot seem to get the Requested For field to populate on the REQ and RITM on the second instance.  I've tried with Display Name, sys_id (from the second instance) and nothing works.  I must not be building it properly in my JSON. Does anyone have any ideas?

Example JSON:

{"sysparm_quantity": "1","requested_for":"ba571269137ad7c063fe7d176144b0f4","variables":{"requested_for":"ba571269137ad7c063fe7d176144b0f4","u_on_behalf": "No","u_action_requested": "Citrix Application Access - Add","u_description": "TEST","user_name": "TEST_USER","first_name": "TEST","last_name": "TEST","u_site_address": "TEST","u_site_name": "TEST","u_department": "4edd930b13e292009f84b6246144b08c","u_speedchart": "TEST","u_set_id": "TEST"}}
7 REPLIES 7

Saikiran Gudur1
Mega Guru

Hi Pat,

The requested_for field is a reference to sys_user table.

First validate the requested_for user details in both the instances are same (Having same sys_id or not), if not it is the reason.

Thanks,
Saikiran Guduri (NOW)
(Please mark the answer as correct answer/helpful if it helps)

patbishop
Mega Guru

Correct.  I was thinking that when I add the item to the cart, that I could specify the Requested For.  I have tried passing in the Display Value and/or the sys_id of the target instance. 

I'm thinking that once the REST APIs are run, that I need to collect the Ticket Numbers that it creates, THEN run an Update Table API to fill in the rest. Is this the correct approach or is there an easier way?

Just to clarify, I was attempting to pass the sys_id of the request for in the Target Instance (hard coded to test).

Hi Pat,

Approach is valid. Please go ahead and share the result.

Thanks,
Saikiran Guduri (NOW)
(Please mark the answer as correct answer/helpful if it helps)

How To Mark Answers Correct From Community Inbox