|
1 | 1 | # CI Deduplication Task Generator |
2 | 2 |
|
3 | | -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). |
| 3 | +This repository contains a ServiceNow customization that enables users to create De-Duplicate Tasks for selected Configuration Items (CIs) directly from a list view using a UI Action. |
4 | 4 |
|
5 | | -### How It Works |
6 | | - |
7 | | -1. Finds all serial numbers that are used on more than one hardware CI. |
| 5 | +When executed, the UI Action confirms the number of selected CIs, calls a Script Include via GlideAjax, and creates a Remediate Duplicate Task using CMDBDuplicateTaskUtils |
8 | 6 |
|
9 | | -2. For each group of duplicates, it checks if any of the CIs are already part of an open de-duplication task. |
| 7 | +### How It Works |
10 | 8 |
|
11 | | -3. If no open task exists, it creates a new one linking all CIs in the group. |
| 9 | +* Allows users to select multiple CIs and trigger de-duplication in one click |
| 10 | +* Automatically creates a De-Duplicate Task record using backend logic |
| 11 | +* Displays confirmation dialogs for task creation and redirection |
| 12 | +* Prevents duplicate task creation for CIs already linked to an open task |
| 13 | +* Redirects to the created De-Duplicate Task record for quick review |
12 | 14 |
|
13 | | -4. Logs a summary of actions taken (tasks created, groups skipped). |
14 | 15 |
|
15 | 16 | ### Dependencies |
16 | 17 |
|
17 | 18 | This script requires the `global.CMDBDuplicateTaskUtils` Script Include to be active in your instance. |
18 | 19 |
|
19 | 20 | ### Configuration & Use |
20 | 21 |
|
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. |
40 | | ---- Re-check Complete --- |
41 | | -Total Duplicate Groups Found: 2 |
42 | | -New Remediation Tasks Created: 1 |
43 | | -Groups Skipped (Already in an open task): 1 |
44 | | --------------------------- |
45 | | -
|
46 | | -
|
47 | | -``` |
| 22 | +Creation of UI Action and asking confirmation of selected Records from List View by using GlideAjax |
0 commit comments