Error using SYS ID for "requested for" while creating INC with OOB endpoint method

Arjit Gourav
Tera Contributor

While trying to create a ticket through a record producer using an API, it's throwing error for some particular sys ID 

The end point is as below:

POST:  /sn_sc/servicecatalog/items/{sys_id}/submit_producer

The sys ID is present and user being active, and the call is getting successful with using USER ID for the user profiles in the "requested for" field. 

But while using the SYS IDs, it's throwing the error as below

        "sys_id""-1",
        "number"null,
        "record""api/now/table/incident/-1",
 
Does anyone have any suggestion for the troubleshooting path to follow for this?
1 ACCEPTED SOLUTION

@Arjit Gourav were you able to get this fixed?


Raghav
MVP 2023

View solution in original post

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

@Arjit Gourav 

how is the request body looking?

are you trying to set user in some reference variable? what type of variable is that?

please share some screenshots.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

{
"variables": {


"field": "value"
"requested_for": "SYS ID",

}
}

 

The body of request looks like above which contains OTHER fields in the body as well. The variable used is a reference type and referring to sys_user table.

@Arjit Gourav 

did you try for some other variable which is of reference type?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes @Ankur Bawiskar , Trying with "Requested By" throws success for the same sys ID and as I check if any difference between the two field configurations in the record producer, couldn't find any single difference between the two i.e. "requested_by" and "requested_for"