Would like for the 'Assign to me' UI Action to auto populate user and assignment group.

Pachee Yang
Tera Contributor

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.

 

 

5 REPLIES 5

Hello,

 

The script will automatically clear the assignment group with the group you put in the group. Incase if you also want to clear the CI please use the below script:-

 

assignToMe();

function assignToMe() {
current.ci=='';
current.assignment_group = 'putthesysidofthegrpwhichyouwanttoenter';
current.assigned_to = gs.getUserID();
current.update();
}

 

Please mark my answer as correct based on Impact.