Disable CI in CMDB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
I have a corrupted CI (Central Interaction).
When I access its record, I get a "(Record not found)" message.
I've tried disabling it through the table, deleting it from the table, and even creating a script and running a deletion script in Fix Scripts, but the record remains active in the cmdb_ci table.
Can anyone help me with this?
- Labels:
-
CMDB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago - last edited 9 hours ago
Hi @samoliveira
var ciSysId = 'YOUR_CORRUPTED_CI_SYS_ID';
var gr = new GlideRecord('cmdb_ci');
if (gr.get(ciSysId))
{ gr.deleteRecord(); gs.print('CI Deleted: ' + ciSysId); } else { gs.print('CI not found in cmdb_ci: ' + ciSysId); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
HI,
I ran the script you sent me, and unfortunately, CI is still listed in cmdb_ci.
Do you have any other ideas on how to disable it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
How are you "seeing" it in cmdb_ci, via a list view or otherwise?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hello @samoliveira
If you know the CI's class (let's say cmdn_ci_web_server) and the sys_id, then you can navigate to CMDB Workspace and delete it from there:
https://yourinstance.service-now.com/now/cmdb/record/cmdb_ci_web_server/5f8af237c0a8010e01a932999468...
You can always print the sys_class_name from a background script:
var grCI = new GlideRecord('cmdb_ci');
if(grCI.get('5f8af237c0a8010e01a932999468b83a')) { //sys_id of CI
gs.print('Name: ' + grCI.name + 'Class: ' + grCI.sys_class_name);
}
Hope that helps!
