Create De-duplicate Task manually by using UI action on list view of CMDB_CI table.
De-duplicate tasks are created when system identifies the duplicate Cis in the discovery process.
In some cases these tasks are not created as expected even though duplicate CI exists.
In a few scenarios clients expecting to create de-duplicate task from the UI action on list view of ''cmdb_ci'' table and this UI action is available to specific group of people.
In Servicenow we have OOTB Script include ‘’CMDBDeduplicateTaskUtil”, to create duplicate task, however In this case we have to specify the sys_ids of specific Cis and execute every time.
So Instead of taking the sys_ids of the CIs every time and execute, we can create button/list choice UI action on the list view and select the specific CIs from CMDB_CI table, this will be easier to the CMDB team whoever wants to create.
This UI action utilizing the OOTB Script include with few modifications as we have to return with newly created de-duplicate task or error if it finds any.
UI Action name : Create De-duplicate Task, Type: List Choice
Step:1
Step:2
Step:3
when we click on OK. We'll get the confirmation.
It will navigate to newly created De-duplicate task, shown below.
Step: 4
If the selected CI is already part of open De-duplicate task then it will give error and displays those CIs
Step:5
Step: 6
Client script:
function getConfigItems() { var sysIDs = g_list.getChecked().toString(); var sysIdList = sysIDs.split(','); var con1 = confirm('Total number of Selected CIs ' + sysIdList.length + '. Click OK to create De-duplicate task'); if (con1) { var ga = new GlideAjax('CMDBtaskCreate'); ga.addParam('sysparm_name', 'createDuplicateTask'); ga.addParam('sysparm_sysids', sysIDs); ga.getXML(CallBack);
function CallBack(response) {
https://www.servicenow.com/community/cmdb-articles/create-de-duplicate-task-manually-by-using-ui-action-on-list/ta-p/2300627