- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2015 11:58 AM
This question is similar to the one asked here Don't allow case to be submitted to empty assignment group but the organizational groups that we have tend to have at least one member in them to allow them to see all sub groups work when looking at "My Groups Work". What we would like to do is not allow an assignment to higher level groups based on a true/false field on the groups table
under form design I created a true/false field name Organizational Group (u_org_group) and after setting the value on the necessary groups would change it to Read Only
the pseudo code that I have is
on change group assignment
if u_org_group in sys_user_group is true
then alert "This is an organizational group, please assign to a different group." and assign to previous group or set to null
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 05:50 AM
We used an onChange client script that calls a script include, another requirement that was added was that only members of those groups would be allowed to assign to the group.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue){
var ajax = new GlideAjax('noAssignGroupUtils');
ajax.addParam('sysparm_name', 'getAssignGroup');
ajax.addParam('sysparm_assign_group',newValue);
ajax.getXML(updateQueue);
}
function updateQueue(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
if(answer){
g_form.clearValue('assignment_group');
g_form.showFieldMsg('assignment_group','You cannot assign a ticket to ' + answer + ' group','error');
alert("You cannot assign a ticket to this group");
return false;
}
}
}
var noAssignGroupUtils = Class.create();
noAssignGroupUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getAssignGroup: function(){
var group = new GlideRecord("sys_user_group");
if(group.get(this.getParameter('sysparm_assign_group'))){
if(group.u_no_assign == true) {
if(gs.getUser().isMemberOf(this.getParameter('sysparm_assign_group')) || gs.getUser().hasRole('admin'))
return;
return group.getDisplayValue();
}
return;
}
},
type: 'noAssignGroupUtils'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2015 07:35 AM
What advantage does the tree picker provide your users?
I only ask because I usually go to non-tree picker and makes reference qualification less of a nightmare.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2015 07:40 AM
they can see who is in a group or what group that group belongs to. sometimes they might know who should be working on an issue but they might not know the group name and it gives them another way to see the hierarchy in case they need to
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2015 07:39 AM
I would possibly look at the following
Create an onchange client script for the Assignment group.
that looks at the list of members of the assignment group and if there are no members it puts an field error message up asking the user to reselect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2015 07:45 AM
we want to avoid using client scripts if possible, but that might work. The only thing is that not all the groups are empty. they usually have VP's in them and they use the top level group for reporting on all their teams that are sub groups, not working on issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2015 07:47 AM
There's no mechanic I know of that can both present a tree view, but prevent you from selecting a parent record. The best you can do in this situation is present a post-selection error message that tells the user they can't pick a parent.