- Joined
- Jan 24, 2025
- Messages
- 5
- Reaction score
- 5
Hi,
We have a customer with over 300 queues. When a new starter joins, we have to manually add them to each queue which is just a nightmare.
I've attempted to write a call flow app with the idea that it executes c# code to add the user into every queue. Has anyone had some luck with this?
We have a customer with over 300 queues. When a new starter joins, we have to manually add them to each queue which is just a nightmare.
I've attempted to write a call flow app with the idea that it executes c# code to add the user into every queue. Has anyone had some luck with this?
using System;
using System.Threading.Tasks;
using TCX.Configuration;
using CallFlow;
namespace dummy
{
public class AssignAgentsToQueues : ScriptBase<AssignAgentsToQueues>
{
public override async Task<bool> StartAsync()
{
// Define the agent extensions
string[] agentExtensions = { "2100" };
// Loop through queue numbers from 8000 to 8999
for (int i = 0; i <= 999; i++)
{
// Format the queue number to match the "80*" pattern (e.g., 8000, 8001, ..., 8999)
string queueNumber = "80" + i.ToString("D3"); // Ensures the number is always three digits (8000, 8001, ..., 8999)
// Retrieve the queue by its number
var queue = PhoneSystem.Root.GetDNByNumber(queueNumber) as Queue;
// Check if the queue exists
if (queue != null)
{
// Loop through each agent extension and add them to the queue
foreach (var agentExtension in agentExtensions)
{
queue.CreateAgent(PhoneSystem.Root.GetDNByNumber(agentExtension));
}
// Save the changes to the queue
queue.Save();
}
}
// Indicate that modifications were made
return true;
}
}
}