Work Items API returns bare `state` UUID despite `?expand=state`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
Fetching a single work item with GET /workspaces/{slug}/projects/{project_id}/work-items/{id}/?expand=state usually returns the expanded state object, but for some work items it returns state as a bare UUID string instead — even with expand=state set. This makes it impossible to resolve the state name from the response alone; a separate /states/ lookup is required only for those items.
Expected
state is consistently expanded to an object when expand=state is passed:
{
"id": "11111111-1111-1111-1111-111111111111",
"name": "PR Created",
"state": {
"id": "22222222-2222-2222-2222-222222222222",
"name": "PR Created",
"group": "started"
}
}
Actual (intermittent)
Same request, different work item — state comes back as a bare UUID:
{
"id": "33333333-3333-3333-3333-333333333333",
"name": "Some ticket",
"state": "22222222-2222-2222-2222-222222222222"
}
Consumers that read state.name get nothing for these items and have to fall back to a /states/ lookup to map the UUID → name.
Details
- Endpoint:
GET /workspaces/{slug}/projects/{project_id}/work-items/{id}/?expand=state - API: REST API (api.plane.so, cloud)
- Impact: intermittent — most items expand correctly, a minority return the bare UUID.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the specified GET request with ?expand=state against work items that currently return an object and those that return a UUID. Trace the REST API response path for state and verify the fix by confirming that every expanded response contains the state object's id, name, and group without requiring a separate /states/ lookup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100