How to create a standard change request via API with display values instead of reference field values?

Sandeep Singh1
Kilo Contributor

I am able create a standard change with:

POST https://<org-sub-domain>.service-now.com/api/sn_chg_rest/change/standard/{standard_change_template_id}

However, I have to pass reference field values to get the request created with appropriate display value. Example:

For a field assigned_to I have to pass value like: 416e07f00f571700b322807be1050efb to make it display my name.

Is there a way to pass the display values directly? If not, what's the best way to get display value for a reference field?

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

It may be about the same - or a difference of where you want the work to be done, but an alternative is to pass in 'John Smith' and have the script on the Scripted REST Resource parse that and query the table to use the sys_id when the change record is created.

View solution in original post

5 REPLIES 5

Sandeep Singh1
Kilo Contributor

Thanks @Brad Bowman! That's what I did. I pulling sys_ids for dynamic fields from respective tables. Only for certain drop-down fields I had to look at the field dictionary and create same mapping in my script. It works fine.