Skip to content

Commit

Permalink
Merge pull request RocketChat#541 from Shailesh351/sb_default_department
Browse files Browse the repository at this point in the history
Assign new Conversations to particular omnichannel department
  • Loading branch information
chadgoss authored Feb 22, 2021
2 parents 4596828 + 2632561 commit ba8f43a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/livechat/server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,14 @@ Meteor.startup(function() {
i18nDescription: 'Assign_new_conversations_to_bot_agent_description',
});

settings.add('Livechat_assign_new_conversation_to_department', '', {
type: 'string',
group: 'Omnichannel',
section: 'Routing',
i18nLabel: 'Assign_new_conversations_to_department',
i18nDescription: 'Assign_new_conversations_to_department_description',
});

settings.add('Livechat_guest_pool_max_number_incoming_livechats_displayed', 0, {
type: 'int',
group: 'Omnichannel',
Expand Down
9 changes: 9 additions & 0 deletions app/livechat/server/lib/Livechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ export const Livechat = {
getRequiredDepartment(onlineRequired = true) {
const departments = LivechatDepartment.findEnabledWithAgents();

const deparmentName = settings.get('Livechat_assign_new_conversation_to_department');

if (deparmentName) {
const department = departments.fetch().find((dept) => dept.name === deparmentName);
if (department) {
return department;
}
}

return departments.fetch().find((dept) => {
if (!dept.showOnRegistration) {
return false;
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@
"Assign_admin": "Assigning admin",
"Assign_new_conversations_to_bot_agent": "Assign new conversations to bot agent",
"Assign_new_conversations_to_bot_agent_description": "The routing system will attempt to find a bot agent before addressing new conversations to a human agent.",
"Assign_new_conversations_to_department": "Assign new conversations to department",
"Assign_new_conversations_to_department_description": "The routing system will attempt to assign new conversation to this department",
"assign-admin-role": "Assign Admin Role",
"assign-admin-role_description": "Permission to assign the admin role to other users",
"assign-roles": "Assign Roles",
Expand Down

0 comments on commit ba8f43a

Please sign in to comment.