Skip to content

Comment creation fails with JSON unmarshal error - ID field type mismatch #1

@alextnetto

Description

@alextnetto

Bug Description

The clickup comment create command fails with a JSON unmarshaling error when trying to parse the ClickUp API response.

Command Used

./clickup comment create --task 86afefc3z --text "test comment"

Error Message

{
  "error": "failed to parse response: json: cannot unmarshal number into Go struct field CreateCommentResponse.id of type string",
  "code": "UNMARSHAL_ERROR"
}

Expected Behavior

Comment should be created successfully and return the comment details in JSON format.

Analysis

The ClickUp API appears to return the comment ID as a number, but the Go struct CreateCommentResponse.id field is expecting a string type.

Environment

  • CLI Version: v1.0.0
  • OS: Ubuntu Linux
  • API: ClickUp v2

Suggested Fix

Change CreateCommentResponse.id field type from string to json.Number or implement custom unmarshaling to handle both number and string types.

Impact

This prevents using comment functionality through the CLI, which is important for AI agent workflows and automation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions