Empty "display_name" and inappropriate "vendor" association for create record using REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 02:29 AM
Hi,
When I create an asset using REST API, the "display_name" provided in postbody is not getting reflected in the created record.
Also, you can see the vendor associated 'sys_id' is different from the one that got associated in created asset record.
Can someone please help me rectify this issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 11:35 PM
Hi @Tony Chatfield1,
Thanks for the respsonse,
We haven't made any customization in my instance for asset creation.
Also, here are the details of the records with vendor association issue.
Developer Instance : dev90149
Vendor record used for association :
name : "postmanvendor"
sys_id : "7be8cdb297543110b44f38200153afbd"
Asset records created :
1. Directly from Dashboard
Asset tag : "hardware1-fromdashboard"
sys_id : "3cccc25d97a03110b44f38200153af78"
Time of Creation : "2023-08-08 12:16:08" GMT-7
2. From postman using rest API
Postbody used for REST API :
{
"asset_tag":"hardware 2 - from postman",
"vendor":"7be8cdb297543110b44f38200153afbd"
}
Response :
Asset tag : "hardware 2 - from postman"
sys_id : "971dc65d97a03110b44f38200153afda"
Time of Creation : "2023-08-08 12:16:52" GMT-7
Wrongly assoicated vendor sysID : 0c43b088c6112275011a4bd46a4e6cc4
I've also added the screen recording of vendor association issue asong with screenshots of the above records' details.
Please check the following link for additional details.
https://drive.google.com/drive/folders/14g_AgMa675q2hPgVT4pyqmPnZwIbyHb-?usp=sharing
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 01:55 PM
Hi, testing your payload in a PDI with postman, I find that the vendor sys_id is correctly populated into the created asset.
In my PDI the record shows as 'empty' as there is no display value because the underlying record does not exist and I would think this correct and expected behavior.
Note the is an OOB Instance, it is domain separated but I have made no changes to asset or cmdb_ci management or enabled any asset management\cmdb_ci type plugins and it may be a plugin driving the value change.
Testing further with an OOB company record, I inserted a couple of assets and the 'vendor' and 'active' flags of the core_company record do not appear to have any impact with the correct record\sys_id being related to all created assets.
Have you checked BR's\scripts that may be running against the table?
You should be able to search for any hard coded instance of the sys_id for company that is being applied in
Studio > Search > Code search (flagging search all applications).
You could also search the sys_properties table for the company sys_id in the 'values' field.
You can also check flow\workflow to see if either of them ran against your record.
Flow > Todays executions
Workflow > All Contexts.
Have you checked other possible relationships to help identify the cause, IE is the company being applied related to the records model etc?