Would like for the 'Assign to me' UI Action to auto populate user and assignment group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 08:27 PM
I would like to make the 'Assign to me' UI action automatically assign to the current user and the group that they belong to in one action. Is this applicable? The only department utilizing Agent Workspace would be a helpdesk group (Agents and the manager). Would this have to be configured through the script? What would I use as the script to achieve this?
The group it should point to is in the table "sys_user_group" and named "Service Center"
Currently, if I choose "assign to me" it will prompt me that I need to input an assignment group in order to use the UI Action. I want to bypass filling in the assignment group to use the UI Action as an all-in-one action.
current script is:
assignToMe();
function assignToMe() {
if (current.assignment_group.nil()) {
var memberGroups = new global.IncidentUtils().getMemberGroups(gs.getUserID(), 2);
if (memberGroups.length > 1) {
gs.addErrorMessage(gs.getMessage("Assigned to user {0} is member of multiple groups, please select one as Assignment group ", [gs.getUserDisplayName()]));
return;
}
if (memberGroups.length == 1)
current.assignment_group = memberGroups[0];
}
current.assigned_to = gs.getUserID();
current.update();
}
Would like a script to auto-populate the agent's name who clicks on 'assign to me' button and their group to auto-populate.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 10:46 PM
Hello,
Currently it checks if user is a part of multiple groups that is when the error message is shown. If a User is part of only one group then it will fill the grp and assigned to with the current script.
Now as per you use case when a user is a part of multiple group how to determine which group needs to be used for assignment group.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 10:59 PM
Thank you for the information. Do you know the script to assign to a specific group for this ui action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 11:07 PM
Hello,
if you say that this UI action will only be used by one grp and the assignment grp will always be the same then you can use the below code:-
assignToMe();
function assignToMe() {
current.assignment_group = 'putthesysidofthegrpwhichyouwanttoenter'
current.assigned_to = gs.getUserID();
current.update();
}
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2022 07:49 AM
Can you also add to this script to remove the current assignment group that populates from the configuration item? When the agent types in the ci it auto-populates the group but most of the time the group related to the ci is not the group the agent is in.
So I need the script to remove the current assignment group that populated from the ci to the assignment group population and assigns the ticket to the user and their assign group.