Search tickets with filters and facets
bakers_ticket_search takes filters and facets instead of query and branch_name; giving both kinds is refused. Without project it covers every project you can read. Rows, total and every count include only tickets you can read.
The filter keys and facet names are those of the ticket list, plus the conductor, its owner and the attention. Each takes a list; any value in the list matches:
| Name | Value | Matches |
|---|---|---|
assignee | user UUIDs | tickets assigned to any of them |
owner | user UUIDs | tickets whose own owner is any of them |
conductor_owner | user UUIDs | tickets on a conductor owned by any of them; not the ticket's owner |
group, project, team, template | UUIDs | tickets in that group, project, project team or from that template |
label | label term UUIDs | tickets with any of the labels |
conductor | conductor UUIDs | tickets on any of them; an unreadable conductor is refused |
state, workflow | ids, e.g. ["plan", "review"], ["bb_work"] | tickets in any of them |
priority | 1 (High), 2 (Medium), 3 (Low) | tickets with that priority |
parent | ticket identifiers, e.g. ["SHOP-12"] | children of any of them |
attention | any of review, plan_ready, question | tickets that need a person for that reason |
Two more filters take true or false: closed and frozen. Every given filter must hold. A null value counts as absent. An empty list, an unknown id or a UUID that does not exist is refused, never answered unfiltered; a label must be a label term.
A ticket's attention is one value, checked in this order: a closed ticket has none; question when it is frozen with the label Question (any letter case); plan_ready in state plan with a plan comment and no claimed or running run; review in state review; otherwise none.
With filters or facets the response adds total, the count of all matching tickets, not capped at the 50 rows. facets lists any of the names above, and the response adds facets: per name, buckets {value, label, count}, most tickets first, then by label. value has the form the filter takes, so a bucket can be passed back as a filter; label is the name, title or option label the ticket list shows. A conductor bucket adds owner and machine, each {uuid, name} or null. A ticket without a value (no assignee, parent, conductor or attention) forms no bucket; a ticket with two labels counts once in each.
"Needs me", the open tickets that need you on your conductors, per project and reason, across all projects in one call. Your user UUID comes from bakers_user_read:
json
{
"filters": {"attention": ["review", "plan_ready", "question"], "conductor_owner": ["<your user uuid>"], "closed": false},
"facets": ["project", "attention"]
}json
{
"tickets": [{"identifier": "SHOP-42", "title": "…", "state": "review", "type": "feature", "branch_name": "…", "base_branch": "main", "parent": null}],
"total": 3,
"facets": {
"project": [{"value": "<project uuid>", "label": "Shop", "count": 2}, {"value": "<project uuid>", "label": "Docs", "count": 1}],
"attention": [{"value": "review", "label": "Review", "count": 2}, {"value": "plan_ready", "label": "Plan ready", "count": 1}]
}
}