- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 07:26 AM
Hey all.
I've got a Transform Map setup to update CI's, I've done coalesce on serial_number and I also have a onBefore Transform Script to only update CI's that are in status=Ready.
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if (target.operational_status == 6) {
ignore = 5;
}
})(source, map, log, target);
However, I still get the following error when running the Transform.
More than one target records exists for target table cmdb_ci_computer with query serial_number=XXXXXXX
Any idea what I am be doing wrong?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 07:45 AM - edited 05-18-2023 07:47 AM
Hi @Owais3 ,
You are not doing anything wrong but you have faulty data in the system.
Check with the serial number on target table - cmdb_ci_computer, if it shows multiple records then you have to clean up the data and make sure there is only one record for a serial number.
Since you have chosen serial number as coalesce field, you must maintain unique serial number for each record in the system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 07:45 AM - edited 05-18-2023 07:47 AM
Hi @Owais3 ,
You are not doing anything wrong but you have faulty data in the system.
Check with the serial number on target table - cmdb_ci_computer, if it shows multiple records then you have to clean up the data and make sure there is only one record for a serial number.
Since you have chosen serial number as coalesce field, you must maintain unique serial number for each record in the system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2023 02:25 AM - edited 05-24-2023 07:50 AM
Thanks @Manmohan K
We are looking into getting the data sorted, however, in the meantime I need to update the CI's that are in status=Ready,
I was thinking of doing a similar script on the serial_number field in the Transform Map to basically match on serial number and update the matched ci if the status is ready.
Would you have an example script for this?