You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This script rechecks the cmdb_ci_hardware table for duplicates by serial number and creates a De-Duplication Task if needed (for records that didn't run through the IRE).
4
+
5
+
### How It Works
6
+
7
+
1. Finds all serial numbers that are used on more than one hardware CI.
8
+
9
+
2. For each group of duplicates, it checks if any of the CIs are already part of an open de-duplication task.
10
+
11
+
3. If no open task exists, it creates a new one linking all CIs in the group.
12
+
13
+
4. Logs a summary of actions taken (tasks created, groups skipped).
14
+
15
+
### Dependencies
16
+
17
+
This script requires the `global.CMDBDuplicateTaskUtils` Script Include to be active in your instance.
18
+
19
+
### Configuration & Use
20
+
21
+
This script is meant to be run as a **Scheduled Job** or as a **Background Script**.
22
+
23
+
Before you run it, you must set the target table.
24
+
25
+
```
26
+
// Change this line in the script!
27
+
var ciTable = "cmdb_ci_hardware"
28
+
29
+
30
+
```
31
+
32
+
Change `"cmdb_ci_hardware"` to the table you want to run the script against.
33
+
34
+
### Example Log Output
35
+
36
+
```
37
+
Starting check for duplicate CIs by serial number...
38
+
==> Successfully created task RITM0010123 for Serial Number "VMW-50-81-7A-C9-23-44".
39
+
--> Skipping Serial Number "SGH814X025". It is already part of an open task.
0 commit comments