- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 01:07 AM
My requirement is to hide the user1 from assigned to when selecting the assignment group while creating an incident ,but the user must be a member in the group.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 05:51 AM
This needs to be added as an advnaced reference qualifier to the assigned_to field, not assignment_group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 04:01 AM
The below script include should work, amend the user sys_id in the encoded query, call the script include excludeUser and call it as an advanced reference qualifier with the syntax: javascript: new excludeUser().excludeUser()
var excludeUser = Class.create();
excludeUser.prototype = {
initialize: function() {
},
excludeUser:function() {
var users = "sys_id=1234";
if(current.assignment_group.getDisplayValue() == 'Network'){
var gr = new GlideRecord('sys_user_grmember');
gr.addEncodedQuery('group=' + current.assignment_group + '^user!=insert your users sys_id here');
gr.query();
while(gr.next()) {
var user = gr.getValue('user');
users += ("^ORsys_id=" + user);
}
}
return users;
},
type: 'excludeUser'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 04:24 AM
Hi David Dubuis
I was not able to call my script include,client callable is active.Is that anything wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 05:20 AM
You've changed the users variable to a sys_id, change it back to the below:
var users = "sys_id=1234";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 05:22 AM
you also need to change the users += line as below. The only sys_id you needed to change was the one in the encoded query.
users += ("^ORsys_id=" + user);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 05:48 AM
Hi David Dubuis
I have modified the changes above you mentioned but after that I was not able to view the assignment groups which i shared in the second image.