- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 09:31 AM
Hey All,
So I'm currently doing an integration with ServiceNow.
However I'm having issues with creating both an Asset and a CMDB_CI item in one post call.
simply, I make a POST call to api/now/table/alm_asset
with a dataset populated with all the Asset fields required.
I then also populate the field CI on the Asset with a CMDB_CI JSON object like so:
ci:{
assigned_to = "example",
installed = "example",
manufacturer = "example",
phone_number = "example"
}
However the Asset does not create the CI. I've also tired the reverse by creating a CMDB_CI item with all the Asset data attached. Still nothing.
Is there anything I'm doing wrong here, or is this not possible?
Kind Regards,
Ben
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2017 01:18 AM
The ones mapped with Asset will be auto copied to CI. Are you talking about the ones specific to CI, your custom fields?
The CI will be created after the asset is inserted, So I believe you need to need to send a second call to update your CI values
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 09:41 AM
Hi Ben,
Model and Model category are mandatory fields required to create an asset. You should first setup a model category that links your asset to a CI and then use API by passing these values to create a new asset. The asset will auto create required CI.
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2017 12:55 AM
Howdy,
Firstly, thanks for the reply .
So When creating the Asset from a POST call I have a fully populated JSON object as so:
{
"model_category":"Communication Device",
"model":"AT&T Mobility (US) Apple iPhone 7 - Black (32 GB)",
"assigned_to":"",
"managed_by":"admin",
"owned_by":"admin",
"company":"example",
"vendor":"EXAMPLE",
"cost":"GBP;400",
"device_imei":"123",
"sim_iccid":"123",
"phone_number":"07580932943",
"location":"EXAMPLE",
"department":"EXAMPLE",
"serial_number":"123",
"cmdb_ci":
{
"installed":"05/10/2017 08:42:41",
"phone_number":"07580932943",
"u_device_imei":"123",
"u_sim_iccid":"123"
}
}
The Configuration Item is created, however Is it not populated with the data I pass through.
Do I have to make a second call to CMDB_CI to populate the linked CI?
Kind regards,
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2017 01:18 AM
The ones mapped with Asset will be auto copied to CI. Are you talking about the ones specific to CI, your custom fields?
The CI will be created after the asset is inserted, So I believe you need to need to send a second call to update your CI values
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2017 01:21 AM
Ah Right, I thought as much! Well not to worry! I thought this could all be done in one call .
Thanks for the help!
Kind Regards,
Ben Hansell