Introducing a new way to review your PRs.

Read the announcement

frappe / helpdesk

Modern, Streamlined, Free and Open Source Customer Service Software

View on GitHub

20 documents · Updated Nov 23, 2026

docs / ticket-communications

Ticket conversations and communications

Ticket communication brings customer emails, agent replies, private agent comments, and related contact activity into one ticket view. The system keeps customer-facing messages separate from internal notes, links files to the message that owns them, and presents the result as a time-ordered activity stream.

Communication model

An email conversation is stored as a Communication linked to the ticket. A customer message is a received communication. An agent reply is a sent communication. The ticket also keeps response dates so message activity can affect the wider ticket lifecycle; see Ticket lifecycle and agent workspace.

An internal note is stored as a core Comment linked to the ticket. It is an agent-only record and does not become customer email. The older HD Ticket Comment record remains a deprecated, readable store for legacy rows; new notes use Comment. The ticket response area lets an agent choose either a reply or a comment, so the audience is clear before the content is sent.

RecordAuthor or senderAudienceTicket view
CommunicationCustomer or agentEmail recipientsEmail activity
CommentAgentOther agentsComment activity
Call logAgent or phone systemAgentsCall activity
Ticket history or viewUser or systemAgentsActivity history

References: helpdesk/…/api.py• L169-239 helpdesk/…/hd_ticket.py• L668-852 helpdesk/…/hd_ticket_comment.py• L7-9 helpdesk/…/comments.py• L7-26 desk/…/TicketTimeline.vue• L175-205

Conversation presentation

The agent desk loads the ticket with communications, comments, history, views, and call activity. It converts these records into common activity entries and sorts them by creation time. The Activity tab shows the combined stream. Emails, Comments, and Calls tabs show only the matching activity type; Calls appears when calling is enabled.

The email entry shows the sender, recipients, copied recipients, delivery state, body, and files. The comment entry shows the author, body, files, and any enabled reactions. A call entry records contact activity for the ticket. History entries describe ticket changes or views. Agents can reply from an email entry, and the composer uses that entry to set the reply recipients and quoted content.

The activity header provides the entry point for call actions. The call action menu lets an agent start a call or open a call log, and a new call log refreshes the ticket activity. The ticket contact area can start a call to the customer when a phone number is available. If the contact has no phone number, the agent is asked to add one before the call starts. The contact area also opens email composition for the displayed customer address.

The customer view shows the customer conversation and its message editor. It offers the email action only while the ticket can still receive customer contact and no feedback result has taken over that control. It does not use the agent-only comment composer.

The stream updates after a new comment, ticket change, or call activity. The agent desk can reload activity when it receives a ticket comment event, so another agent's note can appear without a full page refresh.

References: helpdesk/…/api.py• L38-127 desk/…/TicketActivityPanel.vue• L57-92 desk/…/TicketTimeline.vue• L175-205 desk/…/ActivityHeader.vue• L1-34 desk/…/TicketCallActions.vue• L1-51 desk/…/TicketAgentContact.vue• L1-23 desk/…/TicketCustomerSidebar.vue• L8-37 desk/…/TicketCustomer.vue• L25-87 desk/…/TicketAgent.vue• L139-156

Agent message composition

The agent communication area provides two exclusive editors. Reply opens the email editor, while Comment opens the internal note editor and closes the reply editor if it is open. The editors keep unsent content for the ticket in local browser storage and support keyboard submit and discard actions. Clicking outside an open editor closes it unless the pointer is inside a dialog or menu used by that editor.

An email reply can contain:

  • A message body with rich text.
  • To, Cc, and Bcc recipients.
  • A selected outgoing sender when more than one sender is available.
  • A quoted copy of the message being answered.
  • A signature and uploaded files.

The send action creates a sent communication linked to the ticket. When email workflow is enabled, it also hands the message to the outgoing mail system and records delivery state. Reply and Reply All derive their recipient lists from the selected email and omit the current user where needed. Opening email from the ticket contact area uses the same composition path with the contact's address as the starting recipient.

An internal comment saves rich text as a core Comment linked to the ticket. It can include files and agent mentions. Only agents can create these ticket comments. Existing HD Ticket Comment rows remain readable for legacy data, but the deprecated doctype no longer handles new comment writes.

References: desk/…/CommunicationArea.vue• L1-115 desk/…/CommunicationArea.vue• L140-179 desk/…/CommunicationArea.vue• L205-280 desk/…/EmailEditor.vue• L27-205 desk/…/EmailEditor.vue• L445-501 desk/…/EmailArea.vue• L53-63 desk/…/EmailArea.vue• L203-237 desk/…/TicketAgentContact.vue• L10-23 desk/…/CommentTextEditor.vue• L19-86 desk/…/CommentBox.vue• L294-345 helpdesk/…/comment.py• L13-20 helpdesk/…/hd_ticket_comment.py• L7-9

Customer message composition

The customer editor sends the message through the ticket's contact communication path. The resulting record is a received email communication linked to the ticket, and its files are linked to both the communication and the ticket so the conversation and ticket record can present them.

When a customer replies, the ticket records the latest customer response and can reopen the ticket according to its configured reopen status. When an agent sends a reply, the ticket records the first and latest agent response. These timestamps support response tracking without changing the message record itself.

The customer-facing ticket controls keep internal comments out of this path. The customer can start or continue email contact only while the ticket state permits it; the agent view can still open an email composer directly from the contact details.

References: desk/…/TicketCustomer.vue• L254-283 desk/…/TicketCustomerSidebar.vue• L22-35 desk/…/TicketAgentContact.vue• L18-23 helpdesk/…/hd_ticket.py• L825-868 helpdesk/…/hd_ticket.py• L1084-1117

Attachments

An attachment is a private File record shown by its file name and URL. The composer uploads the file before the message is submitted, then the server attaches it to the new communication or comment. The ticket also receives a link so ticket-level file views can find the same material.

The conversation view presents files below the message body. Images and videos can open in an in-app preview. Plain text files can open as text. Other file types open through their file link. Removing a file from an unsent draft also removes the uploaded file rather than leaving an unused file behind.

Bulk agent replies apply the same attachment set to each selected ticket. The system links the first upload to one ticket and creates linked file records for the remaining tickets, so each ticket has its own attachment link.

References: helpdesk/…/hd_ticket.py• L669-683 helpdesk/…/hd_ticket.py• L758-764 helpdesk/…/hd_ticket.py• L839-868 helpdesk/…/ticket.py• L9-59 helpdesk/…/api.py• L312-322 desk/…/AttachmentItem.vue• L1-32 desk/…/AttachmentList.vue• L1-15

Mentions

Mentions are agent references written into comment HTML. The editor offers agent names in the @ list. When a comment is created or its content gains a new mention, the system sends an HD Notification to each named agent and links the notice to both the comment and ticket.

The notifier compares edited content with the old content. It only sends notices for newly added mentions and skips a mention of the comment author. This keeps an edit from repeatedly notifying the same agent. Mention notices use the core Comment as their source, while old comment links are preserved during the migration.

References: desk/…/CommentTextEditor.vue• L142-149 desk/…/CommentBox.vue• L201-208 helpdesk/utils.py• L136-145 helpdesk/…/mentions.py• L6-49 helpdesk/…/comment.py• L23-29 helpdesk/…/comments.py• L30-46 helpdesk/…/migrate_hd_ticket_comment_to_comment.py• L178-209

Saved replies

A saved reply is an agent-managed message template that can be inserted into the email composer. It has a title, rich-text message, and scope: Personal, Team, or Global. Access to Team and Global replies follows the active team and settings restrictions.

Before insertion, the system renders the template with ticket and user data. This lets one reply use the current ticket context. The picker supports search by title or message and lets the agent preview the available reply before applying it.

A saved reply can also stage actions to apply when the email is sent. Actions can change ticket fields, assign an agent, add or remove tags, or add an internal comment. The system filters actions that are no longer valid before the agent sends the email. It applies the remaining actions after the email send, so a stale action does not block the customer reply; skipped actions are returned for user feedback.

References: helpdesk/…/hd_saved_reply.json• L18-63 helpdesk/…/hd_saved_reply.py• L12-46 helpdesk/…/hd_saved_reply.py• L167-251 helpdesk/…/saved_replies.py• L15-116 desk/…/SavedRepliesSelectorModal.vue• L45-128 desk/…/EmailEditor.vue• L130-142 desk/…/EmailEditor.vue• L400-443

Communication history

Communication history is the ticket's record of contact and work. The ticket API returns email communications, internal comments, ticket activity, view records, and call records as separate sources. The agent desk combines them only for display, while filtered tabs preserve the meaning of each source.

Email records retain threading fields such as sender, recipients, subject, and message identity. A later agent reply points to the newest threadable communication when possible. Incoming mail can therefore continue the same email thread. A reply to a merged ticket is redirected to the safe merge target when one exists.

The initial ticket description also becomes a received communication when a ticket is created with content. Later incoming messages can reopen the ticket. System messages such as acknowledgement and feedback emails are linked to the ticket but are not treated as an agent response for response tracking.

Agents can merge or split conversation history when a ticket boundary changes. A merge copies the source ticket's communications, comments, and files to the selected target while closing and marking the source as merged. The merge dialog limits targets to open or paused, unmerged tickets that are not the source and that match the source customer or requester when those values exist. A split creates a new ticket and moves the selected communication and all later communications, comments, and ticket files to it. Both actions are agent-only and irreversible from the ticket interface.

The activity stream can be opened at a particular email or comment. Search and notification links use the record name to focus and highlight that entry, which helps an agent move from an alert to the exact communication that needs attention. Current internal comments use core Comment records with ticket-specific pin and reaction fields. The old HD Ticket Comment doctype remains only as a deprecated legacy source and is not the active history record for new notes.

References: helpdesk/…/api.py• L113-127 helpdesk/…/api.py• L169-260 helpdesk/…/api.py• L288-469 helpdesk/…/hd_ticket.py• L617-632 helpdesk/…/hd_ticket.py• L1072-1117 helpdesk/…/hd_ticket.py• L172-191 desk/…/TicketActivityPanel.vue• L1-29 desk/…/TicketTimeline.vue• L217-229 desk/…/TicketMergeModal.vue• L1-91 desk/…/TicketMergeModal.vue• L128-172 desk/…/TicketSplitModal.vue• L1-9 helpdesk/…/comments.py• L7-26 helpdesk/…/hd_ticket_comment.json• L2-7

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the Communication fields returned by get_communications aligned with the email activity shape. Missing recipient, delivery, or attachment data can break reply actions or presentation.
  • Keep the activity source types aligned between the ticket activity API, the timeline filters, and the optional Calls tab. A call can disappear from the combined stream or appear in the wrong filtered view if one name changes.
  • Keep the call action menu, contact actions, and telephony hooks aligned with ticket refresh. A call log or ended call must refresh the ticket activity that the agent sees.
  • Keep the attachment ownership links aligned between the ticket and its communication or comment. A message can render without its files when only one side is updated.
  • Keep comment HTML mention markup aligned between the rich-text editor and extract_mentions. A change to the mention data attributes can silently stop notifications.
  • Keep saved-reply action validation, rendering, and post-send application aligned. A new action must be safe both before the email is sent and after it is sent.
  • Keep the communication threading identity and in_reply_to selection aligned with the mail intake path. A missing message identity can stop later replies from joining the ticket thread.
  • Keep the agent and customer permission paths separate when changing message or comment endpoints. Internal comments must not enter the customer conversation by accident.
  • Keep merge and split rules aligned across the activity menu, dialog constraints, and server-side movement of communications, comments, and files. A partial move can leave the conversation split across tickets.
  • Keep core Comment permissions, ticket comment permission hooks, and the agent-only comment composer aligned. A change in one path can expose internal notes to customers or block agent notes.
  • Keep migration and relink rules aligned when changing comment names or attachment and reaction links. Legacy rows must continue to resolve to the active Comment record.

Important failure modes

TriggerConsequenceGuard
An agent sends an email with no To, Cc, or Bcc recipientThe reply is blocked before it creates a sent communicationThe email composer requires at least one recipient
No outgoing email account is available for an agent replyThe reply cannot be handed to the mail systemThe server checks the sender account before sending
A saved-reply action becomes invalid after it is configuredThe email still sends but that action is skippedRendering filters stale actions and application reports skipped actions
A non-agent tries to create a ticket commentThe internal note is rejected before it is savedThe core Comment insert hook requires an agent for ticket comments
A customer reads a ticket with internal commentsPrivate notes could be exposed in the customer viewComment read permission allows only agents with ticket access
A comment contains a mention of the authorThe author could receive an unnecessary self-noticeMention notification skips self-mentions
A customer replies to a merged ticketThe message could be placed on a closed source ticketCommunication update resolves a safe merge target before handling the reply
A draft attachment is removed only from the editor listAn unused private file remains on the serverAttachment removal deletes the uploaded file record
A merge target fails the ticket or customer matching rulesThe merge is rejected or the agent sees no valid targetThe merge dialog limits targets to open or paused, unmerged tickets with matching context and excludes the source
A merge or split moves only message recordsThe ticket history loses comments or files, or shows them on the wrong ticketThe server operation moves communications, comments, and ticket files together
A call contact has no saved phone numberThe call cannot start for the intended customerThe contact action opens phone-number setup before making the call
A legacy comment link is relabelled without its related file or reaction linksThe migrated note can lose its attachments or reactionsMigration patches move linked records to the core Comment name and type

Key files

FileWhy to read it
helpdesk/…/api.pyDefines the permission-aware ticket activity data and the merge and split operations.
helpdesk/…/hd_ticket.pyDefines customer intake, agent replies, comment creation, attachment links, and communication effects on tickets.
helpdesk/…/comment.pyDefines the agent-only write and read boundary for ticket comments and cleanup of comment notices.
helpdesk/…/comments.pyDefines the ticket-specific fields, notification types, and agent permissions added to core Comment.
helpdesk/…/hd_ticket_comment.pyShows that the old comment doctype is retained for readable legacy rows and no longer receives new writes.
helpdesk/…/migrate_hd_ticket_comment_to_comment.pyExplains how legacy comment records and their linked data move to core Comment.
helpdesk/…/repoint_comment_reactions_and_files.pyExplains how reactions, files, and attachment comment links are relabelled after migration.
desk/…/TicketActivityPanel.vueShows the agent tabs and the connection between the timeline and the reply or comment composer.
desk/…/TicketTimeline.vueShows how email, comment, call, and history sources become the ticket activity stream.
desk/…/CommunicationArea.vueDefines the exclusive email reply and internal comment editors and their open, close, and submit behavior.
desk/…/EmailEditor.vueDefines recipient fields, quoted replies, attachments, saved replies, and send validation.
desk/…/CommentTextEditor.vueDefines internal comment entry, mentions, attachments, and draft behavior.
desk/…/TicketAgentContact.vueShows direct email and call entry points for the ticket contact.
desk/…/TicketCustomerSidebar.vueShows when the customer email action is available from the customer-facing ticket details.
desk/…/TicketCallActions.vueShows the agent actions for starting or logging a call and refreshing ticket activity after a log.
desk/…/TicketMergeModal.vueShows the agent-facing contract for moving one ticket's communication history into another.
desk/…/TicketSplitModal.vueShows the agent-facing contract for moving a point in the conversation into a new ticket.
desk/…/ActivityHeader.vueShows the call activity actions available from the activity header.
helpdesk/…/saved_replies.pyDefines saved-reply rendering and the post-send action contract.

For the ticket domain around these conversations, see Ticket management. For status, assignment, and response effects, see Ticket lifecycle and agent workspace. For the customer and contact context behind ticket communication, see Customer records.