List the tickets of a project
page/size until you’ve read hits results. database
is required; without it the request is a 400. A user without a role on the
project gets an empty page rather than a 403.
Results come from the search index: besides the ticket fields they carry
couchDbId, database and an attachments array whose entries have a
fetchable name. Sort with sortby and sortOrder together (e.g.
sortby=LASTMODIFIEDDATE&sortOrder=desc); with only one of them the order is
unspecified.
state.state is one of created, started or completed. Finished tickets
also occur as Completed in older data — see
Detecting completion.
Useful filters
Counts without fetching everything
Useaggregate with an index field name to get facet counts in the same call:
Single ticket
attachments[]. You need to be able to see
the ticket: a 403 means your role does not cover it, a 404 that it does
not exist.
Custom field values
On an Expert plan a project can have up to three custom fields. The project document defines them incustomFields
(GET /projects/{database}/{id}); the values a user filled in sit on each
ticket, in the ticket’s own customFields array. Both the list results and the
single ticket carry it:
id, label, type, and the
choices in richOptions) and adds value. What value holds depends on the
type:
For a choice field, look the ids up in the same entry’s
richOptions to get
the text (also HTML). A field that was never filled in has no value (or
null), and a ticket on which no field was filled in may have no
customFields at all, or null. Match fields on id, which is the same id as
in the project’s customFields; the label can be renamed.
To get only tickets with a value in a field, search on the field’s label
with POST /tickets/search and ask for the values in includeFields:
"customFilterType": "OR" for any of them. The filter exists only on the
POST search, not on GET /tickets.
Custom field values are read-only through the API: creating or updating a
ticket ignores customFields.
