How to not assign a task to a specific employee in Twilio

I'm new to Twilio, and I ran into a problem when developing outgoing dialer currently for pre-dialing. If an employee rejects a task, then the same task should not be offered to this employee. How can I handle this case?

+4
source share
1 answer

Usually, if an employee rejects a task, the employee should be moved to an inaccessible activity. Otherwise, if the worker is the only available and skilled worker, TaskRouter will continue to create new reservations.

You can specify a new ActivitySid upon failure, so that the worker simultaneously moves to inaccessible activity:

https://www.twilio.com/docs/api/taskrouter/worker-js#reservation-reject

In this case, the unavailability of work activity simply means that the employee will not be able to complete any task.

But consider a more complex use case where an Employee can accept, reject or cancel tasks. They must be available to make this choice.

If you have only this agent and they are available, then there is no way to prevent the agent from receiving this task, unless you manipulate the task attributes or work attributes so that the TaskRouter does not assign a task. For example, you can update TaskAttributes to have a list of rejected work SIDs, and then in the workflow indicate that work.sid NOT IN task.rejectedWorkerSids.

Target Workers Expression ​​ ! :

worker.sid NOT IN task.rejectedWorkers
+2

All Articles