sync all the fields of asset when update on cmdb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 05:04 AM
Hi,
I want to sync all the fields same as cmdb, there is mismatch between cmdb and asset and cmdb data are correct.
I want to update all the fields on asset level, when one single field on cmdb is updated(for ex comments) then all asset field can be updated automatically
i written this script to update but this is not updating all fields on asset level
var currentCI = new GlideRecord('cmdb_ci');
currentCI.addEncodedQuery('name=abc');
currentCI.query();
while(currentCI.next())
{
currentCI.comments = "test";
var ca = new AssetAndCISynchronizer();
ca.syncRecords(currentCI, 'alm_asset',false);
currentCI.update();
}
Please help me on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 05:18 AM
Hi,
this happens OOB
As per docs
When an asset has a corresponding configuration item, the asset record and the configuration item record are kept synchronized with two business rules.
- Update CI fields on change (on the Asset [alm_asset] table)
- Update Asset fields on change (on the Configuration Item [cmdb_ci] table)
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 05:46 AM
Yes I know these business rules, but i want to map mismatched data... how can i do it?