CI Class was updated with a wrong class name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2016 07:47 PM
Hi All,
CI Class Name of the records were updated incorrectly via a fix scripts, now we are unable to change this back or update these records to the desired Class name.
Please find the script that was used for update.
Wrong Script that was used to update the records,
function ci_app()
{
var ccmdb = new GlideRecord('u_cmdb_ci_ccmdb');
ccmdb.addQuery('u_ccmdb_ci_hierarchy','CI.APPLICATION');
ccmdb.query();
gs.log("Total CI Application" + ccmdb.getRowCount());
while (ccmdb.next()) {
ccmdb.sys_class_name= 'cmdb_ci_app';--------> Wrong Class Name (there is no such Class name available )
ccmdb.setWorkflow(false);
ccmdb.update();
}
}
Now I am trying to correct this again by a fix script, however I am unable to that. And also in the list View of the records I am seeing "Label" in the class name.
Please Suggest a solution for this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2016 09:16 PM
Hi Vishwas,
I did little analysis at my end : Here is the update.
- I tried to reproduce the same behavior by updating the "sys_class_name" field with the value which doesn't exist in the system i.e from incident to abc value.
- Now I saw that the field "sys_class_name" had the choice value "label" as seen in above screenshot you attached.
- Now I GlideRecord the task table to query this record with additional parameter of sys_id(Please note that I have now changed the table to task as the record was no more in the incident table).
- Now by doing GlideRecord to the target table i.e task, I was able to update the value from label to incident.
I hope this helps ...In your case you have to just tweak by querying the records first via script to double sure that you are using the exact table name during update.