fix(task): resolve close/reopen statuses from the list instead of hardcoding - #45
Open
timimsms wants to merge 1 commit into
Open
fix(task): resolve close/reopen statuses from the list instead of hardcoding#45timimsms wants to merge 1 commit into
timimsms wants to merge 1 commit into
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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