- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 05:54 AM
Hello
I have a business rule setup on incidents which limit some ITIL users to only see tickets assigned to their assignment group:
Thanks
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2024 10:47 PM
Please use the below code and check if this works for you.
if (gs.getUser().isMemberOf('Group_Name')) {
current.addEncodedQuery("caller_idDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORassignment_group=group_sysid^ORwatch_listLIKEjavascript:gs.getUserID()");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 06:00 AM
Try:
assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^ORcaller_idDYNAMIC90d1921e5f510100a9ad2572f2b477fe
Above same as below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 06:04 AM
Combine your query with the OOB user query:
var u = gs.getUserID();
current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u);
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 08:32 AM
I tried this using the else if condition, but I can't seem to get it to work 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 10:59 PM
Hi Abbie,
Could you please try the below code in the query business rule.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var user = gs.getUserID();
if (gs.getUser().isMemberOf('Group_Name'));
current.addEncodedQuery('numberISNOTEMPTY^assignment_group=group_sysid');
else if ('caller_id=' + gs.getUserID() + '^ORwatch_listLIKE' + gs.getUserID())
current.addEncodedQuery('numberISNOTEMPTY');
})(current, previous);
Thanks,
Anitha H V