Skip to content

feat: use v3 API to move task home list#41

Merged
krodak merged 1 commit intokrodak:mainfrom
plainlystated:feat/move-task-home-list-v3
Apr 3, 2026
Merged

feat: use v3 API to move task home list#41
krodak merged 1 commit intokrodak:mainfrom
plainlystated:feat/move-task-home-list-v3

Conversation

@plainlystated
Copy link
Copy Markdown
Contributor

Summary

  • The v2 API only supports adding/removing tasks from additional lists — it cannot change a task's home list, causing Task home list cannot be altered errors when using cup move --to <list> --remove <list>
  • Uses the v3 PUT /workspaces/{id}/tasks/{id}/home_list/{id} endpoint when both --to and --remove are provided
  • Automatically builds status_mappings when the task's current status doesn't exist in the destination list, mapping to the first open status

Test plan

  • Unit tests updated and passing (927/927)
  • Verified against live ClickUp API — successfully moved a task between lists with different status configurations
  • Lint passes on changed files
  • Build succeeds

🤖 Generated with Claude Code

@plainlystated plainlystated force-pushed the feat/move-task-home-list-v3 branch from 989a4da to 4e17590 Compare April 3, 2026 19:47
@plainlystated
Copy link
Copy Markdown
Contributor Author

plainlystated commented Apr 3, 2026

Current code uses the v2 move, which doesn't support changing a ticket's home. This means I can't (eg) move a ticket from my backlog to the current sprint list.

● Bash(cup move 86a44w563 --to NEW_LIST_ID --remove OLD_LIST_ID)
  ⎿  Error: Exit code 1
     Added 86a44w563 to list NEW_LIST_ID; but failed to remove from list OLD_LIST_ID: ClickUp API error 400: Task home list cannot be altered

New proposal: use v3 API

docker run --rm -v "$PWD":/app -w /app -e CU_API_TOKEN=$(cup config get apiToken) -e CU_TEAM_ID=$(cup config get teamId) node:22 npx tsx src/index.ts move 86a9vcg2x --to NEW_LIST_ID --remove OLD_LIST_ID
Moved 86a9vcg2x from list OLD_LIST_ID to list NEW_LIST_ID

The inferred status mapping (pick the first open status) is naive, but for my use-case appropriate. Could be fleshed out further at some point, though I suspect the status quo is generally useful.

Ran the linter this time -- all clear!

EDIT:
...and typecheck.... :)

The v2 API only supports adding/removing tasks from additional lists —
it cannot change a task's home list, which caused "Task home list cannot
be altered" errors when using `cup move --to --remove`.

Switch to the v3 `PUT /workspaces/{id}/tasks/{id}/home_list/{id}`
endpoint when both flags are provided. Automatically builds
status_mappings when the source status doesn't exist in the destination
list by mapping to the first open status.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@plainlystated plainlystated force-pushed the feat/move-task-home-list-v3 branch from 4e17590 to ca72a12 Compare April 3, 2026 19:49
@krodak krodak merged commit 3d5d5fa into krodak:main Apr 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants