How to merge two conditions in Reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 01:56 AM - edited 10-31-2023 02:19 AM
Hello
How can we merge the two separate conditions in a reference qualifier?
Condition 1: javascript: gs.getProperty('crossfuze.cmdb.task_items_query');
Condition 2: javascript: new PrincipalClass().getPrincipalClasses();
Any assistance in resolving the issue would be greatly appreciated.
Thanks and Regards
Kartik Magadum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 02:21 AM
what does that property hold? Is it list of sysIds?
what does that script include function return? Is it list of sysIds?
If answer to above 2 is yes then do you want to have AND condition or an OR condition?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 02:55 AM
Hello @Ankur Bawiskar
The first condition holds
sys_class_nameINSTANCEOFcmdb_ci_service^ORsys_class_nameINSTANCEOFcmdb_ci_appl^ORsys_class_nameINSTANCEOFcmdb_ci_hardware^ORsys_class_nameINSTANCEOFcmdb_ci_database^ORsys_class_nameINSTANCEOFcmdb_ci_comm^ORsys_class_nameINSTANCEOFcmdb_ci_peripheral^ORsys_class_nameINSTANCEOFcmdb_ci_vm_instance^ORsys_class_name=cmdb_ci^ORsys_class_name=cmdb_ci_group^nameISNOTEMPTY
and Second condition just return the class of cmdb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 03:09 AM
what does the script include function return?
why not combine both?
you want to use AND or you want to use OR since I could see already multiple OR conditions for sys_class_name
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 02:58 AM
Hi,
Get the property value in the script include (PrincipalClass) itself and return combined encoded query from function getPrincipalClasses. Then simply call the script include from reference qual.