- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2020 10:12 AM
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?
Solved! Go to Solution.
- Labels:
-
Integrations
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 11:24 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 07:32 AM
Whenever you populate a reference field, you need to supply the sys_id, since that is the value stored in that field on the db. I'm not clear on your next question - do you need to know how to lookup the sys_id when you have a name/display value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 09:04 AM
Yes, I am looking for a way to get the sys_id by display value for a given field. Example: I want to pass the display value John Smith for assigned_to field and want to get the sys_id for John Smith i.e. 416e07f00f571700b322807be1050efb so that I can then create the standard change request using that value for assigned_to field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 09:08 AM
At this moment, I think the only way is to first fetch all sys_ids for each field from db table by making a GET call to respective table:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 11:24 AM
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.