Reference Qualifier for configuration item field in Change request form is not working as expected

VennilaP
Tera Contributor

Hi All,

 

We have to filter out the retired CIs from being selected in the change request form.We have created a reference qualifier and we have created a script include and  updated the encoded query in the script include. It was working as expected till now. 

 

Now , we have a request to update the filter as shown below :

class= hardware and install_status != retired and install_status!= absent or install_status= retired and hardware status = in stock

 

and the script include condition looks like this 

"sys_class_name=cmdb_ci_computer^install_status!=7^install_status!=100^NQinstall_status=7^hardware_status=in_stock";

 

but this brings all the retired CIs irrespective of hardware status.

 

Can you please let me know if there are any other ways to achieve this filter?

 

Thanks,

Vennila

 

 

5 REPLIES 5

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @VennilaP , 

Can please share the script include code ? then it will be the better picture for what we are trying fix.

Sure Siddhesh,

 

function getUpdatedClassName(){

                return "install_status!=100^install_status!=7^sys_class_name=cmdb_ci_environment^ORsys_class_name=x_apd_appdynamics_application^ORsys_class_name=cmdb_ci_firewall_device_palo_alto^ORsys_class_name=x_41846_mobileiron_mobile_device^ORsys_class_name=cmdb_ci_db_mssql_instance^ORsys_class_name=cmdb_ci_netgear^ORsys_class_name=cmdb_ci_storage_switch^ORsys_class_name=cmdb_ci_aix_server^ORsys_class_name=cmdb_ci_apache_web_server^ORsys_class_name=cmdb_ci_appl^ORsys_class_name=cmdb_ci_computer^ORsys_class_name=cmdb_ci_esx_server^ORsys_class_name=cmdb_ci_ip_router^ORsys_class_name=cmdb_ci_ip_switch^ORsys_class_name=cmdb_ci_linux_server^ORsys_class_name=cmdb_ci_microsoft_iis_web_server^ORsys_class_name=cmdb_ci_nginx_web_server^ORsys_class_name=cmdb_ci_printer^ORsys_class_name=cmdb_ci_server^ORsys_class_name=cmdb_ci_service^ORsys_class_name=cmdb_ci_service_discovered^ORsys_class_name=cmdb_ci_solaris_server^ORsys_class_name=cmdb_ci_storage_server^ORsys_class_name=cmdb_ci_chassis_server^ORsys_class_name=cmdb_ci_win_server^ORsys_class_name=cmdb_ci_ip_firewall^ORsys_class_name=cmdb_ci_aws_vpc^ORsys_class_name=cmdb_ci_ec2_instance^ORsys_class_name=cmdb_ci_aws_subnet^ORsys_class_name=cmdb_ci_aws_elb^ORsys_class_name=cmdb_ci_ebs_volume^ORsys_class_name=aws_ebs_snapshot^ORsys_class_name=cmdb_ci_vmware_instance^ORsys_class_name=cmdb_ci_acessory^ORsys_class_name=cmdb_ci_solaris_instance^ORsys_class_name=cmdb_ci_lb_bigip^ORsys_class_name=x_apd_appdynamics_database^ORsys_class_name=x_apd_appdynamics_node^ORsys_class_name=cmdb_ci_db_mongodb_instance^ORsys_class_name=cmdb_ci_db_db2_instance^ORsys_class_name=cmdb_ci_cloud_database^ORsys_class_name=cmdb_ci_db_ora_instance^ORsys_class_name=cmdb_ci_network_circuit^ORsys_class_name=cmdb_ci_vm_instance^ORsys_class_name=cmdb_ci_service_calculated^ORsys_class_name=x_apd_appdynamics_business_transaction^ORsys_class_name=x_apd_^ORsys_class_name=appdynamics_controller^ORsys_class_name=cmdb_ci_ups^ORsys_class_name=cmdb_ci_business_app^ORsys_class_name=cmdb_ci_cloud_ecs_service^ORsys_class_name=cmdb_ci_app_server_tomcat^ORsys_class_name=cmdb_ci_app_server_jboss^ORsys_class_name=cmdb_ci_app_server_weblogic^NQsys_class_name=cmdb_ci_hardware^install_status=7^hardware_status=in_stock^NQhardware_status=missing^ORhardware_status=pending_return^sys_class_name=cmdb_ci_computer^NQsys_class_name=x_apd_appdynamics_remote_service^install_statusISEMPTY^NQsys_class_name=cmdb_ci_query_based_service^operational_status!=2^NQsys_class_name=cmdb_ci_hardware^install_status!=7^install_status!=100^NQinstall_status=7^hardware_status=in_stock";

 

The last line in bold is where we have the issue.

 

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @VennilaP , 

Can you please try this query and let me kow if this works. 

NQsys_class_name=cmdb_ci_hardware^install_status!=7^install_status!=100^ORinstall_status=7^hardware_status=in_stock";  

Hi @Siddhesh Gawade ,

It still brings records with retired install status irrespective of hardware_status.

 

I found this article https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0564887 which states that Using operator (^NQ) in encoded queries causes incorrect reference links in the list view. This is same case as the script include query.

 

I suspect this might be the cause of the issue.