Desk SDKs JavaScript v1
Desk SDKs JavaScript
Desk SDKs
JavaScript
Version 1

System messages

Copy link

With System messages, you can notify your agents of the updates that occur for a ticket when there are changes to a ticket's status, assignee, or priority.

Note: You can customize your system messages in Settings > System messages on the Sendbird Dashboard.


Distinguish system messages from notifications

Copy link

When a client app receives a system message through the onMessageReceived() method of the channel event handler, system messages are distinguished from notifications by a value from the message.customType, and their subtype is specified in the message.data as below:

{
    "message_id" : 40620745,
    "type": "ADMM",
    "custom_type": "SENDBIRD_DESK_ADMIN_MESSAGE_CUSTOM_TYPE",
    "data": "{\"type\": \"SYSTEM_MESSAGE_TICKET_ASSIGNED_BY_SYSTEM\", \"ticket\": <Ticket Object>}",
    "message": "The ticket is automatically assigned to Cindy.",
    ...
}

Note: The transfer property appears only when the message.data property has the value of SYSTEM_MESSAGE_TICKET_TRANSFERRED_BY_AGENT.


Hide system messages

Copy link

As system messages deliver updates of a ticket, they are intended to be displayed for agents only. To hide system messages from your app, refer to the following code snippet:

function isVisible(message) {
    let data = {};
    try {
        data = message.data ? JSON.parse(message.data) : null;
    } catch (e) {
        throw e;
    }

    message.isSystemMessage = message.customType === 'SENDBIRD_DESK_ADMIN_MESSAGE_CUSTOM_TYPE';
    message.isAssigned = data.type === SendBirdDesk.Message.DataType.TICKET_ASSIGN;
    message.isTransferred = data.type === SendBirdDesk.Message.DataType.TICKET_TRANSFER;
    message.isClosed = data.type === SendBirdDesk.Message.DataType.TICKET_CLOSE;

    return !message.isSystemMessage
        && !message.isAssigned
        && !message.isTransferred
        && !message.isClosed;
}

List of system messages

Copy link

System messages are designed to indicate the reason of the update. The following table covers the valid values specified in the message.data.type property and their default messages.

Note: Default messages can be edited in Settings > System messages on your dashboard.

List of message.data.type and default messages

Copy link
message.data.typeDefault message

SYSTEM_MESSAGE_TICKET_ACTIVE_TO_IDLE_BY_AGENT

The ticket status is changed from Active to Idle by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_ACTIVE_TO_IDLE_BY_SYSTEM

The ticket status is automatically changed from Active to Idle.

SYSTEM_MESSAGE_TICKET_ASSIGNED_BY_AGENT

The ticket is assigned to {to_agent_name} by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_ASSIGNED_BY_SYSTEM

The ticket is assigned to {agent.display_name} by the system.

SYSTEM_MESSAGE_TICKET_CLOSED_BY_AGENT

The ticket is closed by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_CLOSED_BY_CUSTOMER

The ticket is closed by the customer.

SYSTEM_MESSAGE_TICKET_CLOSED_BY_PLATFORM_API

The ticket is closed by the Platform API.

SYSTEM_MESSAGE_TICKET_CLOSED_BY_SYSTEM

The ticket is automatically closed.

SYSTEM_MESSAGE_TICKET_GROUP_ASSIGNED_BY_AGENT

The ticket is assigned to the {to_team_name} team by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_GROUP_TRANSFERRED_BY_AGENT

The ticket is transferred from {from_team_name} to the {to_team_name} team by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_GROUP_TRANSFERRED_BY_PLATFORM_API

The ticket is transferred from {from_team_name} to the {to_team_name} team through a Platform API request.

SYSTEM_MESSAGE_TICKET_GROUP_TRANSFERRED_BY_CUSTOMER

The ticket is transferred from {from_team_name} to the {to_team_name} team by a customer.

SYSTEM_MESSAGE_TICKET_GROUP_TRANSFERRED_BY_SYSTEM

The ticket is automatically transferred from {from_team_name} to the {to_team_name} team.

SYSTEM_MESSAGE_TICKET_GROUP_UNASSIGNED_BY_AGENT

The ticket is set to be independent from the {from_team_name} team by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_IDLE_TO_ACTIVE_BY_AGENT

The ticket status is changed from Idle to Active by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_IDLE_TO_ACTIVE_BY_CUSTOMER

The ticket status is changed from Idle to Active by the customer.

SYSTEM_MESSAGE_TICKET_IDLE_TO_ACTIVE_BY_SYSTEM

The ticket status is automatically changed from Idle to Active.

SYSTEM_MESSAGE_TICKET_PRIORITY_VALUE_UPDATED_BY_AGENT

The priority of the ticket is changed to {priority} by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_PRIORITY_VALUE_UPDATED_BY_CUSTOMER

The priority of the ticket is changed to {priority} by the customer.

SYSTEM_MESSAGE_TICKET_PRIORITY_VALUE_UPDATED_BY_PLATFORM_API

The priority of the ticket is changed to {priority} by the Platform API.

SYSTEM_MESSAGE_TICKET_REOPENED_BY_AGENT

The ticket is reopened by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_REOPENED_BY_CUSTOMER

The ticket is reopened by the customer.

SYSTEM_MESSAGE_TICKET_TRANSFERRED_BY_AGENT

The ticket is transferred from {from_agent_name} to {to_agent_name} by {by_agent_name}. Reasons for transfer: "{memo}."

SYSTEM_MESSAGE_TICKET_WIP_BY_AGENT

The ticket status is changed to In progress by {by_agent_name}.

SYSTEM_MESSAGE_TICKET_WIP_TO_UNASSIGNED_BY_SYSTEM

The ticket status is automatically changed from In progress to Pending.