Query Business Rules on task using NQ (OR statement on top level).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2015 05:40 PM
Issue on Fuji: Query Business Rules on task using NQ (OR statement on top level).
Scenario
User with a role (not an ITIL role) needs to see own incidents/requests and all records of e.g. HSEQ or HR (extended from task).
The form list view does not work as before, e.g. the "Show Matching" functionality is broken. This happens only if the OR condition has been used in the query Business Rule.
I managed to get it working using a "addOrCondition" but for more complex Query Business Rules it would be very nice to use the "NQ stuff" .
Any comments/solutions are really appreciated.
Script see below and uploaded:
if (gs.isInteractive() && gs.hasRole('itil')) {
var action = gs.action;
var url = String(action.getGlideURI());
var query = current.getEncodedQuery();
if (url.match(/sys_id/)) {
gs.addInfoMessage('SYS_ID');
} else {
gs.addInfoMessage('NO SYS_ID');
var u = gs.getUserID();
var qc = current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u);
//var qc = current.addQuery("sys_class_name", '!=', 'vvv').addOrCondition("sys_class_name",'!=', 'change_request');
current.addEncodedQuery("^NQsys_class_name!=change_request");
}
gs.addInfoMessage('End Query: ' + current.getEncodedQuery());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2015 01:35 PM
Hi Torsten,
I have not used the NQ operator. It seems to give me trouble on my Fuji instance also. Have you tried just a ^OR? Seems to work for me. What is it that NQ does that OR does not do?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 09:42 AM
Hi Torsten,
I am having the same issue with the '^NQ' operator where it breaks the 'Show Matching' and 'Filter Out' functionality - did you ever find a solution to this?
Regards,
Liv

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 01:14 PM
This will help you the issue of using ^NQ

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 01:14 PM
This will help you the issue of using ^NQ