Skip to content

Bug: custom task IDs fail with 401 — team_id not passed to API #7

@bdmorin

Description

@bdmorin

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 view
  • task edit
  • task delete
  • task activity
  • status set
  • link sync
  • comment 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions