I'm passing by an issue on my Twilio TaskRouter configuration. The thing is that I need to address an incoming task to the worker who has lesser tasks assigned to him/her, not to the longest idle worker (as is the default).
According to Twilio's multitasking documentation, each worker has an assigned_tasks attribute inside their channels. So, I have tried to use this attribute into my order_by clause but it seems not to be working.
{
"task_routing": {
"filters": [
{
"filter_friendly_name": "Worker Filter",
"expression": "transferTargetType == 'worker'",
"targets": [
{
"queue": "WQXXXXX",
"expression": "worker.sid == task.targetSid",
"timeout": 30,
"skip_if": "workers.available == 0"
},
{
"queue": "WQXXXXX",
"timeout": 0,
"skip_if": "workers.available == 0"
}
]
},
{
"filter_friendly_name": "Ordered",
"expression": "1==1",
"targets": [
{
"queue": "WQXXXXX",
"order_by": "worker.channel.chat.assigned_tasks ASC",
"skip_if": "workers.available == 0"
}
]
}
],
"default_filter": {
"queue": "WQXXXXX"
}
}
}
It's important to say that my first filter is not being triggered in this scenario because I'm not passing the transferTargetType attribute.
Any idea why this is not working?
Thanks :D