CI Lookup Rules matching against most recently created CI (if CI is duplicated)

Wei Yau
Tera Contributor
Hello, I understand that if a CI is duplicated in the CMDB when the CI Lookup Rules find a match they will pair with the most recently created CI. I was wondering if it was possible for it to pair with the actual CI the lookup rules identified (even if the CI is a duplicate of another CI) rather than the most recently created CI. For example, in the CMDB, there may be 2 CIs with the same serial number, let's call them ABC_CI and XYZ_CI. XYZ_CI is more recently created than ABC_CI. The CI Lookup Rules identifies a CI with a vulnerability and matches it to ABC_CI, but because the CMDB sees it as a duplicate of XYZ_CI, it automatically sets XYZ_CI as the CI for the vulnerable item. Is it possible to have the vulnerable item keep ABC_CI as the affected CI for the vulnerable item instead of XYZ_CI? Is there a property I can set to prevent this from happening?
2 REPLIES 2

AnveshKumar M
Tera Sage
Tera Sage

Hi @Wei Yau 

If you are using Lookup method as SCRIPT then you can use orderBy() method on your GlideRecord query so that it will fetch the old one instead of newly created.

 

If Lookup method is not of Script type, I don't think we can control this behaviour.

 

Please mark my answer helpful and accept as solution if it helped 👍

Thanks,
Anvesh

I am using script and it's matching the fqdn exactly (in this case ABC_CI). However because the CMDB contains XYZ_CI with a different fqdn but the same serial number, that wrong CI (XYZ_CI) automatically becomes the default.

 

So it's not an order by issue because the script is returning a single sys_id.