-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Summary
Commands that accept custom task IDs (e.g. FIN-12542, GLIC-14041) fail with a 401 error because team_id is not included in the API request when custom_task_ids=true.
Reproduction
clickup auth login # works fine
clickup task view FIN-12542
# => ClickUp API error (HTTP 401): {"err":"Oauth token not found","ECODE":"OAUTH_018"}The same request succeeds with curl when team_id is included:
curl -s -H "Authorization: $TOKEN" \
"https://api.clickup.com/api/v2/task/FIN-12542/?custom_task_ids=true&team_id=1276003" | jq .name
# => "Modify /etc/sysctl.conf"Root cause
In view.go (and several other files), GetTaskOptions.CustomTaskIDs is set to true but TeamID is left at its zero value. Because the struct uses omitempty, team_id is omitted from the URL entirely. The ClickUp API requires team_id when custom_task_ids=true.
// Current (broken)
if isCustomID {
getOpts.CustomTaskIDs = true
}
// Needed
if isCustomID {
getOpts.CustomTaskIDs = true
if tid, err := strconv.Atoi(cfg.Workspace); err == nil {
getOpts.TeamID = tid
}
}Affected commands
Every command that resolves a task by custom ID:
task viewtask edittask deletetask activitystatus setlink synccomment add/comment list(raw URL construction)
Environment
- clickup-cli v0.17.0
- ClickUp workspace with custom task ID prefixes (FIN-, GLIC-, PROV-)
Happy to submit a PR for this.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels