AWA Reassign

service12
Tera Contributor

#Role: You are a ServiceNow technical expert in CSM who needs to troubleshoot the issue below and come up with a solution.

 

 

 

#Problems to troubleshoot:

We have two case types: "complaints and escalations," which is OOB, and another custom-created, "technical support."

We have set up AWA as follows:

Service Channel Condition: Which checks for respective service definitions and utilization condition is kept to State is one of "New, Open, Under Review, Review Complete", and default capacity & work item size is set to 1

Queues: Have a script to determine the exact one via a decision table, and we have work item sort order ['priority', 'created'] and assignment eligibility to auto-assign to the last assigned  

Problem One: The AWA engine is not creating new work items when the case assigned to is emptied, and the state is changed to [Under review / Review Complete], and it only occurs for the custom technical support case type

2 REPLIES 2

vaishali231
Tera Guru

hey @service12 

 

AWA does not trigger just because:
Assignment is removed, or
State is already within the Service Channel condition
AWA only creates a work item when:
The record enters the Service Channel condition, OR
A work item is explicitly created/re-triggered
For OOB case types, this is handled by built-in logic.
For custom case types, that logic is missing.

Solution ( Flow Designer)
Use OOB supported AWA action instead of internal APIs.
Flow Configuration
Trigger: Case - Updated
Conditions:
Assigned To is empty
State is Under Review OR Review Complete
Action:
Create Work Item (Advanced Work Assignment)

 

Alternative (Script-Based Solution)
If you prefer scripting, you can explicitly create a work item.
Business Rule
Table: Case When: After Update
Condition:assigned_to changes to empty
State in Under Review / Review Complete

Script :

(function executeRule(current, previous) {

// Check condition
if (!current.assigned_to &&
(current.state == 'under_review' || current.state == 'review_complete')) {

// Check if work item already exists
var wi = new GlideRecord('awa_work_item');
wi.addQuery('document_id', current.sys_id);
wi.query();

if (!wi.hasNext()) {
// Create new AWA work item
var awaUtil = new sn_awc.AWAUtil();
awaUtil.createWorkItem(current);
}
}

})(current, previous);

Notes
This avoids duplicate work items
If not accessible - use Flow Designer (preferred)

*************************************************************************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh

 

 

HEY @service12 

Hope you are doing well.

Did my previous reply answer your question?

If it was helpful, please mark it as correct ✓ and close the thread . This will help other readers find the solution more easily.

Regards,
Vaishali Singh