Retiring large amount of CI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2023 04:29 AM - edited ‎10-19-2023 04:32 AM
I have a requirement to Retire thousand Cis that is already outdated. Where updated field not on the current year and is empty using Busines rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2023 03:20 AM
Hello @lourenz ,
Please refer to the below link:
If it is helpful, mark it as a thumps-up and accept the correct solution.
Thanks & Regards,
Abbas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2023 03:37 AM
Hi @lourenz ,
U need to create a Fix script for this where u can write a GlideRecord query & update the required amount of CI's in a go. If the CI's are 10k-20k or even more then better to do it in multiple batches.
var gr = new GlideRecord('cmdb_ci');//please modify the table name as per requirement
gr.addEncodedQuery('Paste the query copied form List view from the backend');
gr.query();
while(gr.next()){
gr.operational_status = 'retire';//please use proper backend value for retire
gr.update();
}
Thanks,
Danish