From be1446c9907d0f0daaa4ca54d45c0c3e63142eb8 Mon Sep 17 00:00:00 2001 From: John Gerwin De las Alas Date: Tue, 16 Dec 2025 14:58:49 +0800 Subject: [PATCH] feat(clickup): add comment management commands Add new commands for managing ClickUp comments via the API: - resolve-comment: Mark a comment as resolved - unresolve-comment: Mark a comment as unresolved - assign-comment: Assign a comment to a user - unassign-comment: Remove assignment from a comment Update version to 2.2.0, update help text, and add usage examples to README. Document API limitation: Comment reactions (emoji) are not supported by the ClickUp API v2. Closes #100 --- .../100-clickup-comment-reactions.md | 101 ++++++++++++++++++ scripts/clickup/README.md | 18 +++- scripts/clickup/clickup-api.sh | 43 +++++++- 3 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 docs/limitations/100-clickup-comment-reactions.md mode change 100644 => 100755 scripts/clickup/clickup-api.sh diff --git a/docs/limitations/100-clickup-comment-reactions.md b/docs/limitations/100-clickup-comment-reactions.md new file mode 100644 index 0000000..f6dba58 --- /dev/null +++ b/docs/limitations/100-clickup-comment-reactions.md @@ -0,0 +1,101 @@ +# ClickUp API Limitation: Comment Reactions + +## Issue Reference +- GitHub Issue: [#100](https://github.com/iamgerwin/dotfiles/issues/100) +- Date Documented: 2025-12-16 + +## Summary + +The ClickUp API v2 does not provide documented endpoints for adding or managing emoji reactions on comments. This is a feature that exists in the ClickUp web and mobile UI but is not exposed through the public API. + +## Requested Feature + +Add the ability to: +1. Add emoji reactions to comments (e.g., `:white_check_mark:`, `:+1:`, `:eyes:`) +2. Remove emoji reactions from comments +3. List reactions on a comment + +## API Investigation + +### Endpoints Checked +- `GET /task/{task_id}/comment` - Returns comments but no reaction data in response +- `PUT /comment/{comment_id}` - Supports `resolved` and `assignee` but not `reactions` +- No documented `/comment/{comment_id}/reaction` endpoint exists + +### Official Documentation References +- [Update Comment API](https://developer.clickup.com/reference/updatecomment) +- [Get Task Comments API](https://developer.clickup.com/reference/gettaskcomments) +- [ClickUp Comments Overview](https://developer.clickup.com/docs/comments) + +### What IS Supported +The following comment management features ARE available via the API: +- `resolve-comment` - Mark a comment as resolved +- `unresolve-comment` - Mark a comment as unresolved +- `assign-comment` - Assign a comment to a user +- `unassign-comment` - Remove assignment from a comment + +## Workarounds + +### Option 1: Use Text-Based Reactions +Instead of emoji reactions, add a reply comment with the reaction: +```bash +./clickup-api.sh add-comment TASK_ID "Acknowledged" +``` + +### Option 2: Use Resolve Status +For acknowledgment purposes, use the resolve feature: +```bash +./clickup-api.sh resolve-comment COMMENT_ID +``` + +### Option 3: Use Comment Assignment +Assign the comment to indicate someone is handling it: +```bash +./clickup-api.sh assign-comment COMMENT_ID USER_ID +``` + +## Potential Future Solutions + +1. **ClickUp Feature Request**: Submit a feature request to ClickUp for API support for comment reactions + - [ClickUp Feature Requests Portal](https://clickup.canny.io/) + +2. **Undocumented Endpoints**: There may be undocumented API endpoints that support reactions (common in evolving APIs) + - Risk: Undocumented endpoints may change without notice + +3. **Webhooks**: Monitor for reaction events via webhooks (if available) for read-only access + +## Impact + +| Use Case | Workaround Available | +|----------|---------------------| +| Quick acknowledgment | Use `resolve-comment` | +| Assign for follow-up | Use `assign-comment` | +| Express agreement/disagreement | Add text comment reply | +| Track reaction counts | Not available | + +## Status + +**LIMITATION CONFIRMED** - As of December 2025, the ClickUp API v2 does not support comment reactions. + +## Related Commands Implemented + +Despite the reaction limitation, the following comment management commands were implemented: + +```bash +# Mark comment as resolved +./clickup-api.sh resolve-comment COMMENT_ID + +# Mark comment as unresolved +./clickup-api.sh unresolve-comment COMMENT_ID + +# Assign comment to user +./clickup-api.sh assign-comment COMMENT_ID USER_ID + +# Unassign comment +./clickup-api.sh unassign-comment COMMENT_ID +``` + +## Changelog + +- **2025-12-16**: Initial documentation created +- **2025-12-16**: Implemented resolve, unresolve, assign, and unassign comment commands as partial solution diff --git a/scripts/clickup/README.md b/scripts/clickup/README.md index ce1d48d..04bd9db 100644 --- a/scripts/clickup/README.md +++ b/scripts/clickup/README.md @@ -25,7 +25,7 @@ Comprehensive bash scripts for interacting with the ClickUp API, providing task ## Features - **Comprehensive Task Management**: Create, update, search, and batch manage tasks -- **Comment System**: Add comments and retrieve full conversation threads with replies +- **Comment System**: Add comments, retrieve threads with replies, resolve/unresolve comments, and assign comments to users - **Attachment Handling**: Download individual attachments or batch download all images - **Secure Configuration**: Environment-based API key management - **Error Handling**: Robust error detection with informative messages @@ -214,6 +214,18 @@ Priority levels: ./clickup-api.sh add-comment TASK_ID "Found root cause: - Database connection timeout - Need to increase connection pool size" + +# Mark a comment as resolved (acknowledged/completed) +./clickup-api.sh resolve-comment COMMENT_ID + +# Mark a comment as unresolved (reopen for discussion) +./clickup-api.sh unresolve-comment COMMENT_ID + +# Assign a comment to a team member for follow-up +./clickup-api.sh assign-comment COMMENT_ID USER_ID + +# Unassign a comment +./clickup-api.sh unassign-comment COMMENT_ID ``` ### Attachments @@ -314,6 +326,10 @@ Priority levels: |---------|-------------|---------| | `get-comments` | Get all comments with replies | `./clickup-api.sh get-comments TASK_ID` | | `add-comment` | Add comment to task | `./clickup-api.sh add-comment TASK_ID "text"` | +| `resolve-comment` | Mark comment as resolved | `./clickup-api.sh resolve-comment COMMENT_ID` | +| `unresolve-comment` | Mark comment as unresolved | `./clickup-api.sh unresolve-comment COMMENT_ID` | +| `assign-comment` | Assign comment to user | `./clickup-api.sh assign-comment COMMENT_ID USER_ID` | +| `unassign-comment` | Unassign comment from user | `./clickup-api.sh unassign-comment COMMENT_ID` | | `get-attachments` | List task attachments | `./clickup-api.sh get-attachments TASK_ID` | | `download-attachment` | Download specific attachment | `./clickup-api.sh download-attachment TASK_ID ATTACH_ID` | | `auto-download-images` | Download all image attachments | `./clickup-api.sh auto-download-images TASK_ID` | diff --git a/scripts/clickup/clickup-api.sh b/scripts/clickup/clickup-api.sh old mode 100644 new mode 100755 index 46206d3..ac5ce6f --- a/scripts/clickup/clickup-api.sh +++ b/scripts/clickup/clickup-api.sh @@ -312,7 +312,7 @@ validate_json() { show_usage() { cat << EOF ${CYAN}ClickUp API Script - Enterprise Edition${NC} -Version: 2.1.0 +Version: 2.2.0 ${YELLOW}Usage:${NC} $0 [command] [args] @@ -366,6 +366,10 @@ ${YELLOW}Custom Fields:${NC} ${YELLOW}Comments & Attachments:${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 + unassign-comment COMMENT_ID - Unassign comment from user get-attachments TASK_ID - List attachments download-attachment TASK_ID ATT_ID - Download attachment auto-download-images TASK_ID - Download all images @@ -431,6 +435,43 @@ case "${1:-}" in success_msg "Comment added successfully" ;; + "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" + ;; + + "unassign-comment") + [[ -z "${2:-}" ]] && error_exit "COMMENT_ID required. Usage: $0 unassign-comment COMMENT_ID" + + data=$(jq -n '{assignee: null}') + response=$(make_request "PUT" "/comment/$2" "$data") + echo "$response" | jq '.' + success_msg "Comment unassigned" + ;; + "get-attachments") [[ -z "${2:-}" ]] && error_exit "TASK_ID required"