← All requests
0

Filter tasks by custom field value in the task list API and MCP

OpenSearch & filtersRandy Sauers ·

Summary

GET /task/tasks/{projectId} has no custom field filter. The MCP list_tasks tool mirrors that surface. An agent cannot ask for "all tasks with Doc = PRC-003" or "all tasks with Effort = High" without fetching the whole board and reading each task's custom field values.

Motivation

  • Custom fields hold structured references: IDs, document IDs, decision refs, effort.
  • The UI can filter by custom field, but the API cannot. The UI filter is client-side, so it does not help agents or scripts.
  • Reading custom field values per task is an extra call (get_task_custom_field_values), so a client-side filter is expensive.
  • The MCP is the primary interface for agents; it should expose the same filter.

Proposed changes

  1. Add field (name or ID) and value query parameters to GET /task/tasks/{projectId}.
  2. Support the field types: text, number, date, dropdown, multiselect, boolean. For dropdown and multiselect, match the option label; for date, match the ISO date; for boolean, match true or false.
  3. Apply the filter before pagination, consistent with the existing filters.
  4. Add the same parameters to the MCP list_tasks tool.
  5. Optionally add the filter to the workspace-wide task list when #1959 lands.

Acceptance criteria

  • GET /task/tasks/{projectId}?field=Doc&value=PRC-003 returns only tasks with that custom field value.
  • GET /task/tasks/{projectId}?field=Effort&value=High returns only tasks with that value.
  • The filter composes with status, priority, assignee, label, and date filters.
  • Pagination counts reflect the filtered set.
  • The MCP list_tasks accepts the same filter and returns the same set.
  • Unknown field names or values return an empty set, not an error, or a clear 400 if the API prefers strict validation.

Checked open issues

  • #53 advanced filtering, sorting, grouping and saved views (UI filters, not API or MCP).
  • #107 workspace-level shared custom fields (field scope, not filtering).
  • #2050 board filter on a custom field bug (closed; UI bug, not API).
  • #1986 MCP unable to access custom fields (closed, fixed by #2033; read and write, not filtering).

Additional context

  • Current listTasks parameters: status, priority, assigneeId, page, relatedPage, limit, sortBy, sortOrder, dueBefore, dueAfter. No custom field.
  • The MCP has get_task_custom_field_values and set_task_custom_field_value, but no filter.
  • The UI's custom field filter is client-side; the bug #2050 shows it reads from a per-task cache.

Discussion 0

No comments yet.

Sign in to comment.

Keyboard shortcuts

Anywhere

Go to requests
gh
Go to changelog
gc
Go to notifications
gn
Next or previous page
norp
Leave a text field or close a menu
Esc
Show this list
?

Requests

Move to the next or previous request
jork
Open the selected request
oorEnter
Vote on the selected request
v
Search
/
New request
c

Request

Vote
v
Write a comment
c
Edit
e