Hello community!
Many of you have asked us if it is possible to add agents into various agent groups based on their name. Even though we have this recorded as a feature request, there is a way to do this through the API using a simple script. In this post I will describe an example script that takes newly added agents and adds them into the right agent groups (and even creates new groups if they are not yet configured).
Here are some assumptions and requirements:
- Only agents whose name is ending in
[p]
will be processed. - The name includes something like a three letter word to denote it’s grouping intent, e.g. the three letter airport code of the closest airport to the agent.
- Once an agent is assigned to the right group then the
[p]
postfix will be removed by renaming the agent. - If an agent group with the 3-letter code doesn’t exist then the script will create it.
And here is a diagram of the script’s logic:
The script is provided here as a Colab Notebook if you’d like to test it directly without having to download it (note that your server must be open to requests from the internet in order for this to work on Colab). You can download the whole script as a .py
file by going to File -> Download -> Download as .py
.
Let us know in the comments if you run into any problems with implementing your own logic for grouping and renaming agents. Looking forward to your feedback!
P.S. If you are looking to push this to an AWS Lambda function that is scheduled to run at regular intervals let me know. You can also set this up as a cron job an any Linux server. I can provide more details on both of these.