combine two codes in a reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 03:03 AM - edited 03-21-2024 04:26 AM
hello, i have an advanced reference qualifier with following code:
javascript: ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()
and i would like to add following conditions to it:
sys_class_name IS ONE OF:
cmdb_ci_server
cmdb_ci_business_app
cmdb_ci_aix_server
cmdb_ci_datapower_server
cmdb_ci_esx_server
cmdb_ci_hyper_v_server
cmdb_ci_ibm_frame
cmdb_ci_ibm_zos_server
cmdb_ci_lb_bigip
cmdb_ci_linux_server
cmdb_ci_net_app_server
cmdb_ci_unix_server
cmdb_ci_vcenter_server_obj
cmdb_ci_win_server
can you advice me how?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 06:24 AM
@lmao, I would suggest to create a dictionary override for change_request and use override reference qualifier. In the reference qualifier field invoke the script include. Something like this:
Cheers,
Uttkarsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 06:37 AM
that was my thought too. but there is already a code in there:
install_status!=7^ORoperational_status!=6^nameISNOTEMPTY^nameNOT LIKE.hl
would you suggest putting this line into the script include?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 06:45 AM
If there is already a reference qualifier you probably don't need the OOB one which was in the cmdb_ci dictionary. You can append the code which you got in dictionary override in the query you're building in your script include.
var oldQuery = 'install_status!=7^ORoperational_status!=6^nameISNOTEMPTY^nameNOT LIKE.hl';
var newQuery = oldQuery + '^sys_class_name=cmdb_ci_server^ORsys_class_name=cmdb_ci_business_app^ORsys_class_name=cmdb_ci_aix_server^ORsys_class_name=cmdb_ci_datapower_server^ORsys_class_name=cmdb_ci_esx_server^ORsys_class_name=cmdb_ci_hyper_v_server^ORsys_class_name=cmdb_ci_ibm_frame^ORsys_class_name=cmdb_ci_ibm_zos_server^ORsys_class_name=cmdb_ci_lb_bigip^ORsys_class_name=cmdb_ci_linux_server^ORsys_class_name=cmdb_ci_net_app_server^ORsys_class_name=cmdb_ci_unix_server^ORsys_class_name=cmdb_ci_vcenter_server_obj^ORsys_class_name=cmdb_ci_win_server^EQ';
Cheers,
Uttkarsh