How to set CI active=false

patk1000
Giga Contributor

I have to be missing something incredibly simple here. I can run a glide record query for active=true:

var rec = new GlideRecord('cmdb_ci');

rec.addQuery('active',true);

rec.addQuery('name', 'foobarbaz');

rec.query();

while(rec.next()){

      gs.print(rec.sys_id);

      gs.print(rec.name);

}

...Yet when I want to set active=false, there doesn't appear to be an attribute on the record, nor a column in the cmdb_ci table that I can set.

Questions:

1. What the heck am I missing?

2. Am I completely off my rocker to want to set a CI to active=false? Maybe I'm violating some core ITIL principle?

1 ACCEPTED SOLUTION

Michael Fry1
Kilo Patron

Active is not an oob field on the cmdb_ci table. Most use the Status field.


View solution in original post

7 REPLIES 7

Right there is exactly what we're going to do.


Victor Ruiz
Tera Guru

Use the 'operational status' field.


Daniel Oderbolz
Kilo Sage

Also related to this is the fact that GlideRecord - addActiveQuery() does not work with custom fields. 

Note that there was this idea: Make sure that all OOTB (baseline) tables (with exception maybe of sys_*) have an active field but SN decided that it was not worth to implement this...


If this answer was helpful, I would appreciate if you marked it as such - thanks!

Best
Daniel