Service Catalog REST API - How to Pass Requested For Field - Ebonding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2018 12:23 PM
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"}}
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 06:25 AM
The problem that I'm having is that the workflow looks at the Department table to determine approvals etc. This information is pulled from the user record, so when I attempt to add the Requested For via Table API, it may be too late and the workflow is already canceled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 11:18 PM
My previous approach will not work. The workflow is triggered and run and I cannot seem to update the "Requested For" field after the ticket is submitted from the Cart and Checkout.
It appears that the Cart API may not be the best option.
Has anyone leveraged CartJS with a REST message to POST to another instance? I see in the CartJS details that it allows for the setting of the "Requested For" field, but I essentially need to bundle all of my data and variables up from MY instance, and then add it to the Cart and Checkout on the OTHER instance.
Does anyone have any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2021 11:46 AM
The correct parameter is sysparm_requested_for: