How do I set or change the department of a chat?

Question

I want to use departments to filter or route chat requests to specific groups. How do I set or change the department in Zendesk Chat?

Answer

Before a chat starts

To set the department before a chat session starts, implement one of the options below:

Add the trigger condition Set visitor department to automatically route chats to departments

Use the departments setting to assign the department through the Chat API

If you have the pre-chat form turned on, select the Require Department option that lets end users choose the department when they request a chat

Note: The mobile SDK does not support the use of chat triggers to set departments. This feature is only compatible with the Web Widget or Chat widget.

After a chat starts

After a chat session starts, it's too late for a trigger to make a change. Your agents can manually reassign the ticket or, if you use a bot, assign the chat with the Chat Conversations API. The bot reads the message and initiates a transfer to your specified department.