- 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
‎06-05-2019 08:32 AM
Hello Geoffrey,
This is awesome!
I was looking for a slightly different requirement that I think your code would satisfy with a few small tweaks and I am hoping you can help!
The endgame for us is to be able to use the "Assign to Me" UI Action where your UI Page pops up if the current user looking at the sc_task belongs to multiple assignment groups, have them select the group that want and then have it populate the Assignment group and Assigned to fields.
Would you help me?
I am thinking to call your UI page and then fill the fields....
So I created a UI Action "Assign to me v2" button
Put a check in the box for "Client"
Onclick: group_picker_macro
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();
}
// current.assignment_group = gs.getUser().getRecord().getValue("u_default_group");
current.assigned_to = gs.getUserID();
current.update();
action.setRedirectURL(current);
But it's not working. When I click nothing happens. What am I missing?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2019 10:44 AM
Cory,
I was trying to work something up similar. Currently we import our grmember's from AD. So even though we only have X amount of groups that are type ITIL .. this feature is showing all of them. Haven't been able to get it to only show the ones with ITIL type for assignment group. Any luck?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2024 02:13 AM
Hello,
I've accomplished the same steps as described, however I'm still not able to see the small icon next to assignment_group field. Could you please help, I might be forgetting something.
Thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2020 07:07 AM
No, sorry. I never got the help I needed, so it still is not working for me.