fix(task): resolve close/reopen statuses from the list instead of hardcoding - #45
Conversation
…dcoding `task close` sent status "complete" and `task reopen` sent "open". Those names only exist on lists using ClickUp's default status set; against any custom set the API rejects the update with "Status does not exist". Reproduced on a list whose done status is "shipped". Both now resolve the status from the task's own list by status *type* — done (falling back to closed) for close, the first open status in board order for reopen — and accept --status to override when a list has several. Bulk close resolves per task, since a bulk close can span lists with different sets, and caches per list so one list costs one lookup. Fixes #32 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aqbmccWm1tqttmBUCR5rv ClickUp: 86dxbeqyt
Review — no blockers, ship itCleanest of the three. Resolving by status type rather than name is the correct read of the ClickUp model, the Nice detail: Non-blocking
|
Summary
Fixes #32.
task closesent the literal status"complete"andtask reopensent"open". Those names only exist on lists using ClickUp's default status set — against any custom set the API rejects the update:That list's statuses are
backlog → scoping → in design → in development → in review → testing → ready for development → shipped → cancelled. Nothing is called "complete", so close was simply unusable there.Both commands now resolve the status from the task's own list by status
typerather than name —done(falling back toclosed) for close, and the firstopenstatus in board order for reopen:--statusoverrides on both, for lists with more than one done status.Bulk close resolves per task rather than once, since a bulk close can span lists with different status sets, and caches per list so one list still costs one lookup. A task whose list has no done status fails that task and continues, rather than aborting the batch.
Adds
Client.GetList, which the SDK supported but the client did not expose.Tests
TestClosedStatus/TestOpenStatuscover a real custom set (done wins over closed), the default set, tie-breaking by orderindex among several done statuses, and the error path naming the available statuses. Verified live against a list with a custom status set — the failing command above is frommain, the passing ones from this branch.Checklist
./scripts/ci.shpasses locally — excepterrcheck, which reports the same 27 pre-existing findings onmain, none in files this PR touchescu docs markdown --dir docs/site/commands) — new--statusflags on close/bulk close