SOW: UI Action 'Assign To Me' how to filter groups?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Situation:
When creating a new incident via the service operations workspace, using the '+' button.
There is a UI button is called 'Assign to me' which displays a list of all groups of which the current user is a member.
Business Need:
We need to be able to filter this list based on Group Type.
Question:
Has anyone experienced / attempted to filter the group list to include specific group types. ie. 'itil'
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @KevinConsultant ,
Answering your question, the out-of-the-box "Assign to me" UI action shows all groups the user belongs to. That's right.
To filter: modify or extend the UI Action script to include a condition on group.type.
var userID = gs.getUserID();
var groupGR = new GlideRecord('sys_user_grmember');
groupGR.addQuery('user', userID);
groupGR.addQuery('group.type', 'itil'); // Filter by Group Type
groupGR.query();
while (groupGR.next()) {
gs.info('User is a member of group: ' + groupGR.group.name);
}
My recommendation create a custom copy of the UI Action rather than modifying the OOB one.
If it helps you, please don't forget to mark it as helpful. Thank you!
Best regards,
Renat Akhmedov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
24m ago
Thanks Renat,
This is the OOB function, I created my own UI Action and used your code, but we have the Assignment Group set to mandatory, and when I click the new UI Action I get the message that assignment group is required.
Not sure what I'm doing wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9m ago
Hi Kevin,
Not sure if that is your situation, but the error message you mention suggest no group is stored in the current record assignment_group field (Which means the incident record was created without an assigned_group or somehow removed). If you save your record before hitting the ui action, your logic should work. If that worked and you wish to get rid of the need to save, then you need to find a way to retrieve the information from the form rather than the record.
I hope it helps and good luck!
Cheers,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2m ago
Yes, when I used the '+' to 'Create a New Incident' the assignment is empty. The UI Action OOB presets a list of Groups, of which I am a member to select to assign it to me.
I am looking for the same capability as the OOTB AND to limit the list to groups of a particular type = sys_user_group.type = 'itil'
