Skip to content

task/bulk close: hardcoded status 'complete' fails on lists with differently named done status #32

Description

@timimsms

Context

cu task close and cu bulk close set the task status to the hardcoded string "complete". ClickUp statuses are per-list and user-defined, so on any list whose done/closed status has a different name (e.g. "Done", "Closed", "Shipped"), the close command fails with an API error.

Evidence

  • internal/cmd/task.go:402-407 (TODO at 404):
// Find a closed status in the same list
// For now, we'll use "complete" as the closed status
// TODO: Query the list's statuses to find the actual closed status
updateOpts := &api.TaskUpdateOptions{
	Status: "complete",
}
  • internal/cmd/bulk.go:209bulk close has the same hardcoded Status: "complete".

Suggested fix

Resolve the list's actual closed status before updating: fetch the task's list statuses (list detail includes statuses[] with type fields) and pick the status with type == "closed" (or "done" as fallback). Apply the same resolution in both task close and bulk close, and cover it with a test using a list whose closed status is not named "complete".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions