Best way to disable Configuration Items

MBarrott
Mega Sage

We have a series of configuration items that we would like to retire and remove them as selectable options. 

 

I've modified the Install Status and Operational Status to 'Retired' but they are still showing up as usable options. 

 

Is there a best practice to sunset these CI's?

1 ACCEPTED SOLUTION

MBarrott
Mega Sage

Managed to fix this fairly easily:

 

- I noticed that the cmdb_ci field has a Dictionary Override records for incident, sc_task and change_request. All three of these were overiding the reference qualifier field for the cmdb_ci. 

 

By default (OOTB) the Reference Qualifier field was: sys_class_name!=cmdb_ci_service

 

I modified this and added a condition to filter out CI's which have an Operational Status of '6', which is retired: operational_status!=6

 

Combining these I ended up with: operational_status!=6^sys_class_name!=cmdb_ci_service

 

This ensured that any retired CI's were omitted from the Configuration Item reference field. 

View solution in original post

13 REPLIES 13

Brian Lancaster
Tera Sage

Where are you seeing the CI's still available? Out of the box once set to retired incident and problem should not be visible any retired CI's.

Hi @Brian Lancaster

I opened a pre-existing INC record and tried changing the Configuration Item. The retired CI's I had just updated were selectable. 

Looking at my own environment it looks like I added a before query BR with no conditions so it always runs and the following code.  

Edit: Made a minor update to the code as admin you may need to be able to see retired CIs. This will work for all tables including standard change proposals.

 

(function executeRule(current, previous /*null when async*/ ) {
    if (!gs.hasRole('admin')) {
        current.addQuery('operational_status', '!=', 6); // Anything other then retired
    }
})(current, previous);

 

 

Thanks @Brian Lancaster I will give this a try. Very surprised there isn't just a simple way to de-activate CI's.