- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2018 09:41 AM
The OOB Dynamic Filter pulls in Parent groups. I inserted new Dynamic Filter Option and the Business Rule that it references. Is there a way to modify the Business Rule so that it doesn't pull in the Parent Groups. Only want the script to pulll in groups that have a "Type" that contains Incident, Task, or Change. All of the parent groups don't have a "Type" value.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2018 02:17 PM
Sorry Mike just notice you have your getMyAssignments declared on the prototype. You are going to want to move it of the prototype definition so you can call it directly without creating a UserUtil object:
var UserUtil = Class.create();
UserUtil.prototype = {
initialize: function() {
},
type: 'UserUtil'
};
UserUtil.getMyAssignmentGroups = function(userID){
var queryString = "user=" + userID + "^group.typeLIKE52c230cd21412400abe30817dc6fb00f^ORtypeLIKEa59723f0213d6800abe30817dc6fb09d^ORtypeLIKE2da8677721056400abe30817dc6fb0fe";
var groupsArray = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addEncodedQuery(queryString);
gr.query();
while (gr.next()) {
groupsArray.push(gr.group.toString());
}
return groupsArray;
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2018 07:35 PM
Hi Mike,
The below link could help you :
Dynamically filter a reference field
Also, can you please atach a screenshot for my easy reference?
Thanks,
Adi