The CreatorCon Call for Content is officially open! Get started here.

CMDB Instance REST API and Reference fields when creating records from external system

Yopisn
Tera Contributor

Hello,

I have an external system posting data to our ServiceNow instance through the CMDB Instance REST API.

The issue is with Reference fields: I cannot find a way to send the name or display name of a reference field through a POST and have ServiceNow get the proper record in the table referenced to reference it in the CI.

E.g.: the external system is sending a manufacturer along with each CI. The manufacturer is sent in the request body with it's name and not sys_id (manufacturer:XYZ). When API is called, ServiceNow use the name as a sys_id so it doesn't match a record and the manufacturer is empty when the CI created (manufacturer field reference the core_company table), even though a company exists with the name XYZ.

I tried different things to fix that but cannot solve. Note that the external system cannot request the related record sys_id first through another API call.

Thanks for your help!

 

7 REPLIES 7

Thanks Patrick, it does go through CMDB API and I don't see how IRE could help with that.

Yeah, my only solution so far: we need to first call the API do get the sys_id of each reference, then insert the CI passing the sys_id of each reference. I hope there is another way, considering the number of CI to be created, API calls will grow exponentially this way...

I didn't say it would solve the reference field issue but it will make your CMDB whole. Many customers do not use IRE and wonder why they have dups. 

Sure, thanks for the recommendation.