HTTP 500: Cannot invoke CatalogItem.canView() because "ci" is null when submitting a Record Producer
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Community,
We are integrating with ServiceNow via a custom Scoped Scripted REST API (POST /api/<namespace>/<api>/item/submit) to submit items from an external client.
- What works: Submitting a standard Catalog Item (sc_cat_item) using the payload below succeeds with 200 OK and creates a REQ / RITM:json
{ "sys_id": "<sc_cat_item_sys_id>", "quantity": 1, "variables": { "requested_for": "<user_sys_id>" } }
What fails: Submitting a Record Producer (sc_cat_item_producer) to create an Incident (INC) using the exact same endpoint and JSON structure fails with HTTP 500:
text
Cannot invoke CatalogItem.canView() because "ci" is null- What we have verified:
- Reading the Record Producer's definition via our scoped GET endpoint returns 200 OK with all expected variables, confirming the sys_id exists, is active, and is visible to the integration user.
- Calling ServiceNow's out-of-the-box /api/sn_sc/servicecatalog/items/{sys_id}/submit_producer endpoint directly is blocked by instance security (User Not Authorized: Access to unscoped api is not allowed).Questions:
- What changes are needed in a Scoped Scripted REST API (or in our request payload) so that POST /item/submit can submit a Record Producer and return the generated Incident number when native sn_sc REST APIs are blocked?
0 REPLIES 0