Skip to content

feat: Add comment management capabilities to clickup-api.sh (reactions & resolve) #100

@iamgerwin

Description

@iamgerwin

Summary

Enhance the scripts/clickup/clickup-api.sh script with additional comment management capabilities:

  1. Mark comments as resolved/unresolved - Tag comments as "Resolve" for workflow tracking
  2. Add reactions to comments - Support common reactions like :white_check_mark: on comments

Current State

The current clickup-api.sh supports these comment-related commands:

  • get-comments TASK_ID - Get comments with replies
  • add-comment TASK_ID TEXT - Add comment

Missing functionality:

  • No way to resolve/unresolve comments
  • No way to add emoji reactions to comments
  • No way to assign comments to users

Proposed Changes

Commands to Add

1. Resolve/Unresolve Comments

# Mark a comment as resolved
./clickup-api.sh resolve-comment COMMENT_ID

# Mark a comment as unresolved  
./clickup-api.sh unresolve-comment COMMENT_ID

API Endpoint: PUT https://api.clickup.com/api/v2/comment/{comment_id}

Request body:

{
  "resolved": true
}

2. Assign Comments

# Assign a comment to a user
./clickup-api.sh assign-comment COMMENT_ID USER_ID

API Endpoint: PUT https://api.clickup.com/api/v2/comment/{comment_id}

Request body:

{
  "assignee": 123456
}

3. Comment Reactions (Investigation Required)

# Add reaction to comment (if API supports it)
./clickup-api.sh add-comment-reaction TASK_ID COMMENT_ID REACTION

# Remove reaction from comment
./clickup-api.sh remove-comment-reaction TASK_ID COMMENT_ID REACTION

Note: After research, the ClickUp API v2 does not appear to have documented endpoints for adding emoji reactions to comments. This may be:

  • An undocumented endpoint
  • A feature only available in the UI
  • A feature planned for future API versions

Action: May need to submit a feature request to ClickUp or investigate further.

Research Findings

ClickUp API v2 - Update Comment Endpoint

  • URL: PUT https://api.clickup.com/api/v2/comment/{comment_id}
  • Capabilities:
    • Replace comment content
    • Assign a comment to a user
    • Mark a comment as resolved

Documentation References

Files to Modify

File Change Type Description
scripts/clickup/clickup-api.sh Enhancement Add new comment management commands
docs/best-practices/project-management/clickup.md Documentation Update with new command examples

Implementation Details

New Case Statements for clickup-api.sh

"resolve-comment")
    [[ -z "${2:-}" ]] && error_exit "COMMENT_ID required. Usage: $0 resolve-comment COMMENT_ID"
    data=$(jq -n '{resolved: true}')
    response=$(make_request "PUT" "/comment/$2" "$data")
    echo "$response" | jq '.'
    success_msg "Comment marked as resolved"
    ;;

"unresolve-comment")
    [[ -z "${2:-}" ]] && error_exit "COMMENT_ID required. Usage: $0 unresolve-comment COMMENT_ID"
    data=$(jq -n '{resolved: false}')
    response=$(make_request "PUT" "/comment/$2" "$data")
    echo "$response" | jq '.'
    success_msg "Comment marked as unresolved"
    ;;

"assign-comment")
    [[ -z "${2:-}" ]] && error_exit "COMMENT_ID required. Usage: $0 assign-comment COMMENT_ID USER_ID"
    [[ -z "${3:-}" ]] && error_exit "USER_ID required"
    data=$(jq -n --arg user "$3" '{assignee: ($user | tonumber)}')
    response=$(make_request "PUT" "/comment/$2" "$data")
    echo "$response" | jq '.'
    success_msg "Comment assigned to user $3"
    ;;

Usage Section Updates

Add to the help text:

${YELLOW}Comments Management:${NC}
  get-comments TASK_ID                - Get comments with replies
  add-comment TASK_ID TEXT            - Add comment
  resolve-comment COMMENT_ID          - Mark comment as resolved
  unresolve-comment COMMENT_ID        - Mark comment as unresolved
  assign-comment COMMENT_ID USER_ID   - Assign comment to user

Acceptance Criteria

  • resolve-comment command marks a comment as resolved
  • unresolve-comment command marks a comment as unresolved
  • assign-comment command assigns a comment to a specified user
  • Help text is updated with new commands
  • Documentation is updated with examples
  • Error handling follows existing patterns (proper error messages, validation)
  • Commands use existing make_request wrapper for consistency

Technical Notes

  • The existing make_request function already supports PUT method
  • Authentication and retry logic are already implemented
  • Follow the existing code style and error handling patterns
  • Use jq for JSON construction consistent with other commands

Priority

Medium - These features enhance comment workflow management for AI-assisted task tracking

Labels

enhancement, scripts, clickup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions