Can We Retrigger AWA (Advanced Work Assignment) in Servicenow

s_35
Giga Contributor

Hello,
Scenario 1: We are working in a Scoped Application in which We had a Requirement where we need to add Live agents to the Virtual agent Chat based on Availability & Bandwidth of the agents in Service now. Foe that we had a Group Call Agents Group & we had created a New Queue with name as  Agent queue, under Chat Channel (Which was created for Interaction table at Global level) & in that Queue we have added Respective Agent Group under Assignment Eligibility tab. Once we initiate chat it is redirecting to chat notifications respective group users & there is no issue in it, but we need to know can we retrigger AWA for the same group for 3 times in a row?
For eg: If we have 3 agents/users in that Agents Group, AWA has been triggered & respective notification has been sent to available users in that group & No one has been Accepted the request & in that case can we reiterate the same request to same available users for Second & Third  time even after no one has accepted it for first time (We have Provided 20 sec as Time out for each user to accept or reject the request)?

Scenario 2: Can we create new Channel in AWA for VA chats in Interaction table where we can redirect the chat to respective Channel & Queue based on VA through which they start the convertion as we have different set of Categories & based on Categories we need to trigger AWA for respective group People in Servicenow.

Scenario 3: Is there a way can we add group instead of Users where we need to Override the Capacity Under AGent Capacity Override tab Under Channel.

If any one has worked on above requirements Please provide your inputs.
Thank you

1 REPLY 1

Community Alums
Not applicable

Hi @s_35 ,

Scenario 1: Retriggering AWA Requests for the Same Group

To retrigger AWA (Advanced Work Assignment) requests for the same group multiple times when no agent accepts the chat request, you can implement a retry mechanism. This involves setting a timeout (e.g., 20 seconds) for agents to accept or reject the request. After the timeout, a script or workflow checks if the assignment has been accepted. If not, it increments a retry counter and retriggers the assignment. Here's an example script:

 

 

var retryCount = current.u_retry_count || 0; // Retrieve retry count
if (retryCount < 3) {
    current.u_retry_count = retryCount + 1; // Increment retry count
    current.update(); // Save the updated count
    // Reassign the task
    sn_awa.AWAAssignment.reassignTask(current);
} else {
    // Handle the case when all retries are exhausted
    gs.log("Task assignment retried 3 times without acceptance.");
}

 

 

Scenario 2: Creating a New Channel for Virtual Agent Chats

To redirect Virtual Agent (VA) chats to specific queues based on categories, you can create a new AWA channel. Navigate to Advanced Work Assignment > Channels and create a channel with the interaction table as its source. Then, use Virtual Agent topics or flows to assign chats dynamically to the appropriate queue. For dynamic assignment, you can leverage the AWA.Queue API, as shown below:

 

 

var assignment = new sn_awa.AWAAssignment();
assignment.setChannel("new_va_channel"); // Replace with your channel name
assignment.setQueue("queue_based_on_category"); // Determine queue dynamically
assignment.assignTask(current);

 

 

Scenario 3: Overriding Agent Capacity with Groups

While AWA supports capacity overrides at the user level, you can implement custom logic for group-based capacity overrides. Define a total capacity for the group and dynamically calculate individual agents' usage. Use a custom table or field to track group capacity and write a script to enforce group-level limits. For example:

 

 

var groupCapacity = 10; // Define total group capacity
var usedCapacity = 0;

// Fetch agents in the group
var gr = new GlideRecord("sys_user");
gr.addQuery("sys_id", "IN", groupMembersArray); // Replace with group member sys_ids
gr.query();
while (gr.next()) {
    usedCapacity += getCurrentCapacity(gr.sys_id); // Custom function for user capacity
}

// Check if the group has capacity
if (usedCapacity < groupCapacity) {
    // Assign task to the group
    sn_awa.AWAAssignment.assignTask(current);
} else {
    // Log capacity exceeded
    gs.log("Group capacity exceeded, task not assigned.");
}