# Subtask

A checklist subtask on a work item: a title, an optional rich-text note and a ticked-off flag, held in the work item's own checklist order. Subtasks only mean anything under the work item they belong to, so they are listed and created through that work item and read, edited and deleted on their own flat path. There is no organisation-wide collection of subtasks and no `filter[work_item_id]`.

## Used by
- GET /api/v2/subtasks/{subtask}: Read a subtask (Subtask)
- PATCH /api/v2/subtasks/{subtask}: Update a subtask (Subtask)
- GET /api/v2/work-items/{work_item}/subtasks: List a work item's subtasks (SubtaskList)
- POST /api/v2/work-items/{work_item}/subtasks: Add a subtask to a work item (Subtask)

## Subtask fields
- id (integer, required): Unique identifier.
- work_item_id (integer, required, server-assigned): The work item whose checklist this subtask belongs to. Taken from the path on create and not writable.
- title (string ≤ 255, required): Subtask title, as shown on the checklist row. This is the field `?q=` searches.
- description (html or null, required, detail only): Optional note on the subtask. HTML from the rich editor, sanitised on read and on write. Null when the subtask is just a title.
- is_resolved (boolean, required): Whether the subtask is ticked off.
- order (integer, required, server-assigned): Position in the work item's checklist. Assigned on create as the next position in that checklist, changed only by dragging in plnnrly, and not writable.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Creation timestamp.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp; use for incremental sync.
- work_item (Ref or WorkItemSummary, required): The work item this subtask hangs off.
- links (SubtaskLinks, required)
  - self (url, required): The canonical URI of this record.

Only on `?view=detail`: description

## Variants

### SubtaskList

What a collection returns, and what `?view=summary` returns on a single record.

9 fields.
Omits: description

### SubtaskSummary

The embedded form: what you get when another resource carries this one and you did not `include` it.

3 fields.
Omits: work_item_id, description, order, created_at, updated_at, work_item, links

### SubtaskLinks

The `links` object on this resource.

Keys: self

## Example
```json
{
  "id": 1,
  "work_item_id": 1,
  "title": "Wire up the SSO callback",
  "description": "<p>…</p>",
  "is_resolved": false,
  "order": 1,
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "work_item": {
    "id": 1
  },
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1"
  }
}
```
