I have retired quite a few CI's that should no longer be used anymore. I have it so you can't see them if you try typing them but there is still the "Look Up Using List" icon that they show and let you use them. How can i get them out of that list so you cannot select them at all? See screenshot.
What I need to know is how I can update something so it doesn't show in that list. SN told me it's the reference qualifier but they can't type it in it won't show them with my script but it's that icon that is the issue. Any ideas.??? I can't figure out where it's pulling the information from this is what i see in the URL bar when i go to it so I imagine there is somewhere it can be updated at.
"https://landolakestest.service-now.com/cmdb_ci_list.do?sysparm_target=incident.cmdb_ci&sysparm_target_value=&sysparm_reference_value=&sysparm_nameofstack=reflist&sysparm_clear_stack=true&sysparm_element=cmdb_ci&sysparm_reference=cmdb_ci&sysparm_view=sys_ref_list&sysparm_additional_qual=&sysparm_dependent=9c2882c8aca710001ae74bd805319052&sysparm_client_record=session"
Thanks so much
Wendy
It doesn't make sense to me
It doesn't make sense to me why it doesn't pull up correctly with just inside my script include which see below i specifically telling it not to pull up retired CI's
getLimitCIs();
function getLimitCIs(){
gs.log('this is runnning...');
var answer = '';
var count = 0;
var ci = new GlideRecord('cmdb_ci');
var strQuery = 'sys_class_name!=cmdb_ci_snc_component';
strQuery = strQuery + '^sys_class_name!=u_cmdb_ci_subcategory';
strQuery = strQuery + '^sys_class_name!=cmdb_ci_service';
strQuery = strQuery + '^sys_class_name!=u_cmdb_ci_appl_sec_module';
strQuery = strQuery + '^sys_class_name!=u_cmdb_ci_appl_sec_roles';
strQuery = strQuery + '^install_status!=7';
ci.addEncodedQuery(strQuery);
ci.query();
while(ci.next()){
gs.log('ci found');
count += 1; //incremented each time it founds a record
if(count > 0){
answer += (',' + ci.sys_id);
}
else {
answer = ci.sys_id;
}}
gs.log (answer);
return 'sys_idIN' + answer;
}
Thanks so much
Wendy
Can be simplified
Just add the following as your Reference qualifier:
...instead of using a script as the Advanced Reference Qualifier because you already know what you want to filter out. You can enter up to 255 characters in that field.
I believe the problem you were having is the result was not making it all the way back. You called your function but then did nothing with the returned value. Someone else was having a similar problem with that today, but they really need to run a script to build the qualifier. This was my response - http://community.servicenow.com/forum/14978#comment-32300
jim.coyne@compucom.com
ITIL V3 Foundation Certified
ServiceNow Certified System Administrator
ServiceNow Certified Implementation Specialist
According to SN this is
According to SN this is currently a problem PRB564886 which they said "After further investigation, this is actually a problem in our platform when a Reference Qualifier exist and Tree_Picker=true.
It will ignore all reference qualifier even if it is there.
Problem "PRB564886" is attached to this incident and I will set the state to Pending Problem.
Currently there isn't any workaround, so I would recommend to not use "tree_picker=true" if you want your reference qualifiers to not be ignored even though it gets run." -
I couldn't remove the tree picker because our CI's are based off Service. By removing Tree Picker it removed that value
Thanks so much
Wendy
Well, I know for a fact
Well, I know for a fact that's not correct - I have a reference field using the tree picker and reference qualifiers and it's working just fine. However, I think the problem might be the way your reference qualifier is set up.
The reference qualifier needs to be either a string or a function; to do both, you have to set the function to add to the string. So your reference qualifer might be:
javascript:'install_type!=7' + getLimitCIs()
Then your script include would have to be set to return adding to the encoded query string, returning something like
return "^name=MyName^type=MyType";
For more info, here's where I learned how to do it:
http://wiki.servicenow.com/index.php?title=Reference_Qualifiers#Multiple_Conditions_on_a_Reference_Qualifier
Hope that helps.
edit to add: By the way, that article says the function needs to be in a global business rule, but that's a bad idea. Better make a Script Include named the same as the function and define the function in there.
Zach Kenyon

System Administrator
What is the content of your
What is the content of your getLimitCIs() Script Include, or, hopefully not, Global Business Rule?
I think the system is getting messed up because you are trying to do a couple things there on the Reference qualifier field:
You are using both an "advanced" reference qualifier with the getLimitCIs() function call and a "simple" qualifier with the install_status!=7 qualifier. And the u_service in the Dependent field may not be helping either.
jim.coyne@compucom.com
ITIL V3 Foundation Certified
ServiceNow Certified System Administrator
ServiceNow Certified Implementation Specialist