How to get the queueID in a script node?

Hello,
Use case: a user is chatting with a bot and as fallback we initiate a human handover.
In order to implement an escalation process, I try to control from which queue a chat conversation is coming in a script node. Is the queueID stored in a variable available in script nodes in an experience flows?
Thanks already for your support!

Hi @denis.vandenbergen ,

Welcome to Kore.ai Community
We are checking the use case shared with us and we will keep you updated with our response.

Thank you,
Srujan Madderla
Kore.ai Community Team

1 Like

Hello @denis.vandenbergen ,

To retrieve the queue id, you can directly access it from the Queues tab.

For the implementation of agent transfer to a custom queue, you can utilize the following code within the script task:

agentUtils.setQueue('queueID');

Experience flow screenshot added below.

Monitor’s interaction tab screenshot added below :

Please note that the same process can be executed directly from the XO platform as well. Simply insert the provided code right above the configured agent transfer node.

Adding documentation link below for your reference :

https://docs.kore.ai/smartassist/utils/script-nodes-call-flows-agent-utils/#Set_Queue

Hope this helps.

1 Like

Hello @jyotheendra.doddala
Thank you for your answer.
But it is the step just before that I’m looking for… I want to use the setQueue with a variable containing the queue initiating the flow where my script with the setQueue is defined.
The use case:

  1. we send the conversation to a queue (let say queueABC) for human handover.
  2. After 40 seconds we target the NoAvailableAgent experience flow (in the queue configuration).
  3. In this experience flow we want to catch from which queue comes the conversation (thus queueABC) in a variable we can use to define which is the new escalation queue to target (let say queueDEF).

In concreto, I want to use a case statement. And therefore I need to receive “queueABC” in a variable. Is there a context variable containing the queue linked to the conversation?
Example:
var originQ = [the variable I’m searching for];
switch(originQ) {
case “queueBelfiusHome1_ID”:
agentUtils.setQueue([“queueBelfiusHome2_ID”]);
break;

Hope it is more clear…
Thanks!

Any feedback on this??