- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2017 01:38 PM
Hi All,
User like the "Add My Group" and "Add Me" buttons next to the Assignment Group and Assigned To fields on the incident form.
My question is...has anyone figured out how you can have the "Add My Group" button and if you are in more than one group, a pop-up menu appears for you to select the exact assignment group you want for this particular incident?
I know using a "default" or "primary" flag for a user so the majority of the time the "Add My Group" will be relevant.
I also know if you can make the assignment group dependent on Company, Cat, Subcat you can usually narrow down which assignment groups will display.
However, most companies aren't that mature to have incidents auto assign yet, so for now they would like to keep using the "Add My Group" and if in more than one group give them a quick menu option or filter there choices automatically to the logged on user.
I haven't looked into assigning groups to certain Category+Subcat combos like Remedy does.
If someone has already done this, let me know how it's working for you.
For example, when Cat=Database and SubCat= error then only present the assignment groups that have been predetermined to support that combo.
I'm going to go read up on assignment rules now to see if that will help.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2017 03:10 PM
Assignment Rules are definitely the way to go if you want to auto-assign based on Category, etc.
I just build something simple to create an Assignment group picker (I love this kind of stuff ).
Obviously it is a simple implementation and you would have to customise is it for your own needs.
Create a UI Macro:
Name: group_picker_macro
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate>
// Only show the icon if the User has multiple groups
var ga = new GlideAggregate('sys_user_grmember');
ga.addQuery('user', gs.getUserID());
ga.addAggregate('COUNT');
ga.query();
var count = (ga.next()) ? parseInt(ga.getAggregate('COUNT')) : 0;
var display = (count > 1) ? 'inline-block' : 'none';
</g2:evaluate>
<script>
// launch the GlideModal popup
function showGroupPicker() {
var gm = new GlideModal('group_picker');
gm.setTitle('Pick an Assignment group');
gm.setWidth(400);
gm.render();
}
</script>
<span id="group_picker_icon" class="icon ref-button btn btn-default btn-ref" style="padding:3px;display:$[display];" onclick="showGroupPicker()">
<span class="glyphicon glyphicon-user" style="margin-top: 5px;"></span>
</span>
</j:jelly>
Create a UI Page:
Name: group_picker
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate>
// Get a list of the User's Groups
var groups = new GlideRecord('sys_user_grmember');
groups.addQuery('user', gs.getUserID());
groups.orderBy('group.name');
groups.query();
groups;
</g:evaluate>
<style>
.group-picker .list-group-item:hover { cursor: pointer; background-color: lightgoldenrodyellow; }
</style>
<ul class="list-group group-picker">
<j:while test="${groups.next()}">
<li class="list-group-item" onclick="setGroup('${groups.group.sys_id}','${groups.group.name}')">${groups.group.name}</li>
</j:while>
</ul>
</j:jelly>
Client Script:
function setGroup(sys_id, name) {
g_form.setValue('assignment_group', sys_id, name);
g_form.setValue('assigned_to', g_user.userID, g_user.getFullName());
GlideDialogWindow.get().destroy();
}
Configure the Dictionary Entry for the Assignment group field and add this Attribute: ref_contributions=group_picker_macro
Result:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2017 03:10 PM
Assignment Rules are definitely the way to go if you want to auto-assign based on Category, etc.
I just build something simple to create an Assignment group picker (I love this kind of stuff ).
Obviously it is a simple implementation and you would have to customise is it for your own needs.
Create a UI Macro:
Name: group_picker_macro
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate>
// Only show the icon if the User has multiple groups
var ga = new GlideAggregate('sys_user_grmember');
ga.addQuery('user', gs.getUserID());
ga.addAggregate('COUNT');
ga.query();
var count = (ga.next()) ? parseInt(ga.getAggregate('COUNT')) : 0;
var display = (count > 1) ? 'inline-block' : 'none';
</g2:evaluate>
<script>
// launch the GlideModal popup
function showGroupPicker() {
var gm = new GlideModal('group_picker');
gm.setTitle('Pick an Assignment group');
gm.setWidth(400);
gm.render();
}
</script>
<span id="group_picker_icon" class="icon ref-button btn btn-default btn-ref" style="padding:3px;display:$[display];" onclick="showGroupPicker()">
<span class="glyphicon glyphicon-user" style="margin-top: 5px;"></span>
</span>
</j:jelly>
Create a UI Page:
Name: group_picker
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate>
// Get a list of the User's Groups
var groups = new GlideRecord('sys_user_grmember');
groups.addQuery('user', gs.getUserID());
groups.orderBy('group.name');
groups.query();
groups;
</g:evaluate>
<style>
.group-picker .list-group-item:hover { cursor: pointer; background-color: lightgoldenrodyellow; }
</style>
<ul class="list-group group-picker">
<j:while test="${groups.next()}">
<li class="list-group-item" onclick="setGroup('${groups.group.sys_id}','${groups.group.name}')">${groups.group.name}</li>
</j:while>
</ul>
</j:jelly>
Client Script:
function setGroup(sys_id, name) {
g_form.setValue('assignment_group', sys_id, name);
g_form.setValue('assigned_to', g_user.userID, g_user.getFullName());
GlideDialogWindow.get().destroy();
}
Configure the Dictionary Entry for the Assignment group field and add this Attribute: ref_contributions=group_picker_macro
Result:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2017 05:04 PM
Geoffrey,
You are a genius!!!!
I've scoured the internet for a week trying to find a way to accomplish this.
I've been a Remedy developer for 10 years and now I'm a newbie again with SNOW.
I appreciate your helping me.
If I could just spend 2 days with you for some mentoring, that would be so great!!!
I would fly to your location and be your student.
I've had the SNOW classes but nothing is like working with someone who really likes what they do.
Thanks again.
Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2017 05:24 PM
Hahaha!! I'm happy to help. There are plenty of people on here who know what they're doing. I was just the first to reply. Just keep posting questions and we can point you in the right direction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2018 08:02 AM
Geoffrey,
If you are out there, maybe you can help me.
We are using the group_picker macro and ui page. Works great.
Now we would like to alter the addQuery so it only displays the groups a person belong to where the group type contains "Support". We've add a bunch of other group types that aren't groups you would assign incidents to.
"type" is not a value in the sys_user_grmember so I don't know how to get to sys_user_group from sys_user_grmember where the "type" field is located which is then actually in the sys_user_group_type table.