Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforcedQueueFilter in worker attributes only allows for one queue #702

Open
SeanHolden opened this issue Jan 8, 2025 · 1 comment
Open

Comments

@SeanHolden
Copy link

I really want to filter out a specific queue for my call center team but it seems I can only filter by a single string, and whatever I put in will be the only queue in the list.

For example, if I have 10 queues and I want to filter out "Team_A" for only certain workers, so that they can't see "Team_A", this is impossible.

I can do the opposite and use enforcedQueueFilter in the worker attributes and display one single queue name thanks to this line of code:

... but it would be much nicer if this was an array so that I could include all the queues I'd like any specific agent to see.

I'd maybe suggest something like this as the filter block:

.filter((queue) => {
  const attributes = workerClient?.attributes as CustomWorkerAttributes;
  const enforcedQueueFilters = attributes?.enforcedQueueFilter as string[];
  if (enforceQueueFilterFromWorker() && Array.isArray(enforcedQueueFilters)) {
    return enforcedQueueFilters.some(filter => 
      queue.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())
    );
  }
  return queue;

This would allow enforcedQueueFilter in worker attributes to be an array of strings with multiple queue names to be shown for this specific worker.

@SeanHolden
Copy link
Author

I've submitted a pull request here: #703 that does just this, and have ensured it is backwards compatible with the current string version by accepting both string or an array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant