Overview
The Tickets API allows you to manage support tickets in Frappe Helpdesk. Tickets are the core entity representing customer support requests.Ticket DocType Fields
TheHD Ticket DocType contains the following key fields:
Auto-incremented ticket ID
Ticket subject/title
Detailed description of the ticket
Email address of the person who raised the ticket
Current ticket status (links to HD Ticket Status)
Category of the status (Open, Closed, Paused, etc.)
Ticket priority (links to HD Ticket Priority)
Type/category of the ticket (links to HD Ticket Type)
Assigned team (links to HD Team)
Associated contact record
Associated customer (links to HD Customer)
SLA Fields
Service Level Agreement applied to this ticket
Expected first response time based on SLA
Expected resolution time based on SLA
SLA status: First Response Due, Resolution Due, Failed, Fulfilled, or Paused
Response Metrics
Time taken for first agent response
When the first response was sent
Average response time for this ticket
Timestamp of last agent response
Timestamp of last customer response
Resolution Fields
Details about how the ticket was resolved
When the ticket was resolved
Total time to resolution
Feedback
Customer satisfaction rating
Selected feedback option (links to HD Ticket Feedback Option)
Additional feedback comments
Assign Ticket to Agent
Assigns a ticket to a specific agent.This endpoint is defined in
helpdesk/api/ticket.py:5The ID of the ticket to assign
The ID of the agent to assign the ticket to. If not provided, assigns to the current user (frappe.session.user)
Response
The updated HD Ticket document with the new assignment
Error Cases
- Throws error if
agent_idis not a valid HD Agent - Throws error with message: “Tickets can only be assigned to agents”
Get List Data
Retrieves a list of tickets with flexible filtering, sorting, and column selection.This endpoint is defined in
helpdesk/api/doc.py:18 and works for any DocTypeThe DocType to query (e.g., “HD Ticket”)
Filters to apply to the query
Field to sort by
Number of records to return
Column configuration for the list view
Fields to fetch from the database
Whether to filter fields for customer portal view
Response
Array of ticket objects matching the query
Column definitions used in the view
List of fields included in each record
Available fields for filtering (only for HD Ticket)
Total number of records matching filters
Number of records in current page
Special Filter: @me
The API supports@me in filters which automatically converts to the current user:
Get Filterable Fields
Returns the list of fields that can be used for filtering tickets.The DocType (e.g., “HD Ticket”)
Limit to customer-visible fields
Response
Returns an array of field objects:Internal field name
Field type (Link, Data, Select, etc.)
Display label for the field
Options for Link/Select fields
Get Quick Filters
Returns the fields configured as quick filters for tickets.The DocType (e.g., “HD Ticket”)
Response
Returns an array of quick filter configurations with label, name, type, and options.Remove Assignments
Removes ticket assignments from specified assignees.The DocType (typically “HD Ticket”)
The document name/ID
List of user IDs to remove from assignments
Whether to bypass permission checks
Example: Creating a Ticket
Using Frappe’s standard document API:Example: Querying Tickets
Standard Frappe API Methods
Since HD Ticket is a standard DocType, you can use all Frappe document APIs:frappe.get_doc("HD Ticket", ticket_id)- Get single ticketfrappe.get_list("HD Ticket", filters={...})- Query ticketsfrappe.get_value("HD Ticket", ticket_id, fieldname)- Get specific fieldfrappe.db.set_value("HD Ticket", ticket_id, fieldname, value)- Update fieldfrappe.delete_doc("HD Ticket", ticket_id)- Delete ticket