Reference qualifier on configuration item field not working on incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 06:12 AM - edited 06-04-2024 06:14 AM
After adding the field active to the cmdb_ci table
i have changed the reference qualifier in incident table for the field "configuration item"
form :
javascript: ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()
to
javascript: ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? 'u_active=true' : 'u_active=true^operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()
and it doesn't work show me all Ci active and not active
link: /now/nav/ui/classic/params/target/sys_dictionary.do%3Fsys_id%3D743b87573321021059ad5d567d5c7b77%26sysparm_view%3Dadvanced%26sysparm_view_forced%3Dtrue
could you help please
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 06:49 AM
Hi,
This article may help you - https://www.servicenow.com/community/developer-forum/oob-reference-qualifier-on-configuration-item/m...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 08:22 AM
Thank you @pooja_m
i tried this background script it work fine but the Reference qualifier always not working shows me all CIs
var current = new GlideRecord("incident");
if (current.get("a32fa731836e0a10c137b0a8beaad316")) {
var list = new GlideRecord("cmdb_ci");
var q = ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1 ? 'u_active=true' : 'u_active=true^operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join();
gs.info("------------1------- :"+q);
list.addEncodedQuery(q);
list.setLimit(20);
list.query();
while (list.next()) {
gs.info(list.getDisplayValue());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:59 AM
Did you change the Reference qualifier on the Dictionary Override record for the incident table, or directly on the Dictionary Entry for the cmdb_ci field?