Modify value of install_status in cmdb

CHAIMA ABBASSI
Tera Contributor

Hello Community 

I tried to modify a value of install_ status in sys-choice.list in cmdb  and i used a fix script but it dosn't work , could you help me .  I choose proceed background not proceed because i have a millions of ci

Regards 

3 REPLIES 3

Nilesh Pol
Tera Guru

@CHAIMA ABBASSI Use below updated script:

var gr = new GlideRecord('cmdb_ci');
gr.addEncodedQuery('install_status=5^discovery_source!=SG-AWS^discovery_source!=SG-Azure');
gr.setWorkflow(false);
gr.autoSysFields(false);
gr.query();

var count = 0;
while (gr.next()) {
gr.install_status = 8; // or any valid sys_choice value
gr.update();
count++;
if (count % 1000 == 0) {
gs.print(count + ' records updated...');
}
}
gs.print('Done. Total records updated: ' + count);

Hello,

The 2 scripts doesn’t work in customer instance but it Work in my pdi instance.

Pratiksha
Mega Sage
Mega Sage

Whats the use case?