Need help with Fix script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2026 09:32 AM
Hi All,
I have the below requirements for certain child classes of DB Instance:
For the existing duplicates, check if there are any records having same name, version and related child, then retire the older records if not already.
Also copy the field values of these 3 fields from the latest one in the old records to the latest record if empty:
Support Group, Owned By and Tags
Please help on the above, Sharing a Fix script I have written.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2026 02:46 PM - edited 09-07-2026 02:47 PM
Hi @Chandrika4
May try replace
if (!latestCI || oldCIIds.length === 0) {
continue;
}
to
var shouldContinue = (!latestCI || oldCIIds.length === 0) ? true : false;
var finalContinue = shouldContinue ? continue : null;
finalContinue;
This helps other users find accurate and useful information more easily
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2026 06:11 PM
I'd suggest using de-duplication tasks which you can create manually with CMDBDuplicateTaskUtils
As to your script, where does it fail? Only thing that sticks out is that tags do not work like normal fields, you'd have to update the corresponding entry in the [label_entry] table
