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 / contact-management

Contact management

Contact management keeps the people who raise or receive support work tied to the right customer and ticket context. Agents can create and maintain contact records, connect them to one or more customers, invite them to the customer portal, and use their contact history while handling tickets. See Customer and contact relationships for the wider relationship model. See Customer records and Ticket management for the related customer and ticket flows.

Contact role in support relationships

A contact is a person record used to identify a requester. An HD Customer is the organization or account that owns the support relationship. A customer connects to contacts through HD Customer Member rows, while a ticket can point to both the contact who raised it and the customer it concerns.

Contact identity

The contact record holds a person’s name, photo, email addresses, phone numbers, and optional linked user. The linked user gives the person portal access and supplies activity data such as time zone and last activity; the contact remains the identity used by tickets and customer membership.

References: helpdesk/…/contact.py• L134-207 helpdesk/…/hd_customer_member.json• L8-27

Customer membership

Customer membership expresses which customers a contact can represent. A contact may belong to more than one customer, and each membership can mark the contact as a customer manager. The customer can also name one primary contact; that contact is always treated as a manager for that customer.

References: helpdesk/utils.py• L104-133 helpdesk/…/hd_customer.py• L74-97 helpdesk/…/hd_customer.json• L69-105

Relationship flow

The relationship model moves from a person record to customer membership and then to ticket context. This diagram shows how the same contact can provide identity for several customer relationships while each ticket still selects one customer.

flowchart LR
    Contact[Contact person] --> Membership[Customer membership]
    Membership --> CustomerA[Customer A]
    Membership --> CustomerB[Customer B]
    Contact --> Ticket[HD Ticket contact]
    CustomerA --> TicketCustomer[Ticket customer]
    CustomerB --> TicketCustomer
    Ticket --> TicketCustomer

References: helpdesk/utils.py• L116-133 helpdesk/…/hd_ticket.json• L327-338

Contact desk experience

The desk gives agents a list view for finding contacts and a record page for understanding one person’s support context. The list and record routes are /contacts and /contacts/:id, and the record page links back to customer and ticket views.

Contact list

The contact list supports selection, standard list filtering, and row navigation. It presents the person’s identity with an avatar and highlights available mobile numbers so an agent can move from search to contact work quickly.

References: desk/…/Contacts.vue• L1-24 desk/…/Contacts.vue• L40-75 desk/…/index.ts• L99-107 helpdesk/…/contact.py• L15-43

Contact record page

The contact page presents the person’s main details together with linked customers, ticket statistics, last-seen information, and invitation state when relevant. Its two tabs show tickets for the contact and feedback recorded on those tickets; when a contact belongs to several customers, the ticket view can filter by the linked customer.

References: desk/…/Contact.vue• L15-94 desk/…/Contact.vue• L196-237 helpdesk/…/contact.py• L183-232

Contact actions

Users with contact permissions can edit the record or open actions for portal access and removal. The available access actions depend on the contact state: a contact without an invitation or linked user can be invited, an existing invitation can be sent again, and a contact with a linked user can receive a password reset email.

References: desk/…/Contact.vue• L25-43 desk/…/Contact.vue• L239-322

Contact data operations

Contact operations preserve a usable identity for support work while allowing the person’s communication details to change over time. Creation uses a short form, while editing supports the fuller set of contact details and keeps unsaved changes visible. Permission-aware search helps desk views find existing people, while contact information lookup supplies relationship and access context for a record page.

Contact creation

The Create Contact dialog collects a name, photo, email, phone, and optional customer choice. It can also start an invitation at the same time. The service requires a first name and valid email, and it validates a phone number when one is supplied before it creates the contact.

When the dialog includes a customer and an invitation, the invitation carries both the new contact and the selected customer. A contact that is not invited can still be linked later from its record or from the customer’s contact area.

References: desk/…/NewContactDialog.vue• L3-108 desk/…/contact.ts• L272-321 helpdesk/…/contact.py• L87-131

Contact editing

The Edit Contact dialog supports multiple email addresses and phone numbers. One email must remain primary, and the user can choose a primary phone when phone numbers exist. A linked user also exposes a time zone field, which keeps the user account and contact view aligned.

The dialog shows existing customer links as read-only destinations. If no customer is linked and there is no pending invitation, it can add one customer during save. Customer membership changes made from a customer record remain the main path for managing richer membership state.

References: desk/…/EditContactDialog.vue• L20-175 desk/…/contact.ts• L146-216 helpdesk/…/contact.py• L134-180

Contact removal

Deleting a contact first asks what to do with its linked tickets. The agent can detach the contact from those tickets or delete the tickets when the required permissions allow it. The delete operation also removes the contact from customer memberships and pending invitations.

If the contact was a customer’s primary contact, removing it clears that primary link and the customer fields that came from it. This prevents a customer from retaining contact details for a record that no longer exists.

References: desk/…/DeleteWithTicketsDialog.vue• L1-25 desk/…/Contact.vue• L96-112 helpdesk/…/contact.py• L46-84 helpdesk/…/hd_customer.py• L295-310

Customer contact workspace

Each customer record has a Contacts area for viewing and managing its members. This workspace is the place where an agent assigns customer roles, chooses the primary contact, reviews contact activity, and starts invitations.

Customer contact cards

The customer view displays each member as a card with contact details, last activity, and active ticket count. A card links to the contact record, while its actions can set the member as primary, change the member role, or remove the member from that customer.

References: desk/…/CustomerContactTab.vue• L1-46 desk/…/ContactCard.vue• L1-77 helpdesk/…/hd_customer.py• L170-196

Customer roles

The Customer role lets a member raise tickets for the customer and manage the tickets they raised. The Customer Manager role lets a member view all tickets raised by that customer and assign other members as managers. The primary contact is also a manager, so changing the primary contact changes the access expectation for that customer.

References: desk/…/InviteContactDialog.vue• L129-141 desk/…/ContactCard.vue• L218-287 helpdesk/…/hd_customer.py• L90-128

Contact invitations

The Invite Contact dialog accepts existing contact records or new email addresses. A person with an existing linked user joins the customer directly; an email without that user link produces a pending invitation. The inviter chooses either the customer or customer-manager role, and pending invitations remain visible in the same dialog until accepted or revoked.

References: desk/…/InviteContactDialog.vue• L1-84 desk/…/InviteContactDialog.vue• L145-200 helpdesk/…/hd_customer.py• L237-332

Ticket contact context

Tickets use the contact link to preserve who the support request concerns. The customer link preserves which customer owns that request, so the two links work together rather than replacing each other.

Ticket contact association

When a ticket has a contact, the ticket desk can show that person’s name, email, phone, and image. If no saved contact exists, the ticket can still show the sender address as a temporary contact view. Agents can open the saved contact and can call the person when a usable phone number exists.

References: helpdesk/…/api.py• L38-81 helpdesk/…/api.py• L656-679 desk/…/TicketContact.vue• L1-49

Contact and customer selection

For new tickets, the system can find a contact from the sender address. When automatic customer selection is enabled, one customer linked to that contact is selected without extra input. If the contact belongs to several customers, a portal user must choose the customer; a customer that is not linked to the contact is rejected for non-agent users.

The association flow therefore protects both sides of the relationship: the portal user can act only as their own contact, and the selected customer must be one that contact represents. Agents can work across these links when they need to correct or route a ticket.

References: helpdesk/…/hd_ticket.py• L279-363 helpdesk/…/hd_ticket.py• L317-360

Ticket contact view

The ticket page uses the contact context for direct communication and for navigation to the person’s history. The same contact data supports email composition, phone calls, and the contact-specific ticket view, which keeps an agent’s actions tied to the requester.

References: desk/…/TicketAgentContact.vue• L1-53 desk/…/TicketAgentContact.vue• L79-95 desk/…/TicketAgent.vue• L1-20

Change checklist

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

  • Keep the Contact email and phone rules aligned between the create dialog, edit dialog, and contact API. A mismatch can allow a record to be created that the edit flow cannot save.
  • Keep customer membership changes aligned with primary-contact and manager-role rules. A primary contact must remain a listed member and must have manager access.
  • Keep contact deletion behavior aligned across tickets, customer membership rows, and user invitations. Leaving one link behind creates stale customer or portal context.
  • Keep ticket contact validation aligned with customer selection. A contact linked to several customers must not silently select the wrong customer for a portal ticket.
  • Keep contact search and customer invite filters aligned with the email and linked-user rules. Otherwise the customer workspace can offer duplicate or unusable invite choices.

Important failure modes

TriggerConsequenceGuard
A contact is assigned to a customer that is not in its memberships by a non-agent userTicket save fails because the requester cannot act for that customerValidate the contact’s linked customers before changing customer context; hd_ticket.py enforces this rule
A portal contact raises a ticket for another contactTicket save fails with a permission errorResolve the session contact from the linked user and allow only that contact for non-agents
A contact belongs to several customers and a portal ticket has no customerThe system cannot know which customer owns the requestRequire an explicit customer choice for the portal ticket
A primary contact is removed from a customerThe customer could retain an invalid primary link or copied contact detailsClear the primary contact and its copied fields during membership removal
A contact is deleted while tickets or invitations still point to itTicket, customer, or invitation views can show a missing personDetach or delete linked tickets and clear customer and invitation links as part of deletion

Key files

FileWhy to read it
desk/…/Contacts.vueShows the contact list entry point and row navigation.
desk/…/Contact.vueShows the contact record page, ticket and feedback tabs, access actions, and deletion entry point.
desk/…/contact.tsDefines the contact form state and the relationships between desk actions and contact services.
helpdesk/…/contact.pyDefines contact creation, editing, information lookup, search, and deletion behavior.
helpdesk/…/hd_customer.pyDefines customer membership, roles, invitations, primary contacts, and contact summaries.
desk/…/CustomerContactTab.vueShows how a customer exposes its contact workspace.
desk/…/ContactCard.vueShows the user-facing member actions for roles, primary state, and removal.
helpdesk/…/hd_ticket.pyDefines contact ownership checks and customer selection rules for tickets.
helpdesk/…/api.pyDefines the contact context returned to the ticket desk.