-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add assignee support to Zendesk update ticket component #18275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add assignee support to Zendesk update ticket component #18275
Conversation
- Add attachments prop definition to zendesk.app.mjs for multiple file uploads - Add uploadFile() and uploadFiles() helper methods with MIME type detection - Modify update-ticket action to support file attachments via Zendesk uploads API - Update version to 0.2.0 and package version to 0.7.2 - Enhanced success message to show attachment count
- Add guard for missing upload token and fail fast with clear error message - Remove duplicate summary emission from uploadFiles method - Use actual upload token count instead of input array length for summary
- Add full HTTP/HTTPS URL support with axios for remote file fetching - Extract filename from Content-Disposition header or URL path for URLs - Use response Content-Type when available for better MIME detection - Replace blocking readFileSync with async fs.promises.readFile - Add proper input validation and JSDoc documentation - Implement concurrent uploads with Promise.allSettled for better performance - Add comprehensive error aggregation showing all failed uploads - Filter and trim attachment input for robustness
- Add assigneeId prop with dynamic agent dropdown selection - Add assigneeEmail prop for email-based ticket assignment - Update ticket data to include assignee_id and assignee_email fields - Enhanced summary messages to reflect assignee updates - Maintain backward compatibility with optional props - Follow Zendesk API v2 specification for ticket updates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Caution Review failedFailed to post review comments. Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (23)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2024-12-12T19:23:09.039ZApplied to files:
🧬 Code graph analysis (1)components/zendesk/actions/update-ticket/update-ticket.mjs (4)
WalkthroughThis PR updates multiple Zendesk components. Most files have patch version bumps. New features add attachments upload and assignee selection support via zendesk.app methods and props, and integrate them into the update-ticket action. Package version and dependencies are updated in package.json. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UpdateAction as update-ticket.mjs
participant App as zendesk.app.mjs
participant Zendesk as Zendesk API
User->>UpdateAction: Run with ticketId, fields, [attachments], [assigneeId/email], [tags]
rect rgba(200,230,255,0.3)
note over UpdateAction: Optional attachments handling
UpdateAction->>App: uploadFiles({ attachments, customSubdomain, step })
alt any attachments provided
App->>App: For each file: uploadFile(...)
App->>Zendesk: POST /api/v2/uploads.json (file stream)
Zendesk-->>App: 201 Created (upload token)
App-->>UpdateAction: [upload tokens] or throw on any failure
UpdateAction->>UpdateAction: Add tokens to comment.uploads
else no attachments
UpdateAction-->>UpdateAction: Skip uploads
end
end
rect rgba(220,255,220,0.3)
note over UpdateAction: Build ticketData
UpdateAction->>Zendesk: PUT /api/v2/tickets/:id.json { ticket: ticketData }
Zendesk-->>UpdateAction: 200 OK (updated ticket)
end
opt tag operations
UpdateAction->>Zendesk: Add/Remove/Set tags
Zendesk-->>UpdateAction: Tag operation response
end
UpdateAction-->>User: Return updated ticket + summary
sequenceDiagram
autonumber
participant CallSite as Any action
participant App as zendesk.app.mjs
participant FS as File/HTTP
participant Zendesk as Zendesk Uploads API
CallSite->>App: uploadFiles({ attachments })
alt attachments.length > 0
loop each attachment (concurrent)
App->>FS: getFileStreamAndMetadata(path or URL)
FS-->>App: stream + { contentType, size, filename? }
App->>Zendesk: POST /uploads.json (binary) with headers
Zendesk-->>App: token or error
end
App-->>CallSite: tokens[] or throw if any failed
else
App-->>CallSite: []
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
- Bump component version from 0.2.0 to 0.2.1 - Bump package version from 0.8.2 to 0.8.3 - Remove trailing spaces to fix linting errors
Updated 20 component versions to satisfy CI requirements: Actions: - add-ticket-tags: 0.0.3 → 0.0.4 - create-ticket: 0.1.7 → 0.1.8 - delete-ticket: 0.1.7 → 0.1.8 - get-ticket-info: 0.0.5 → 0.0.6 - get-user-info: 0.0.2 → 0.0.3 - list-locales: 0.0.2 → 0.0.3 - list-macros: 0.0.2 → 0.0.3 - list-ticket-comments: 0.0.2 → 0.0.3 - list-tickets: 0.0.5 → 0.0.6 - remove-ticket-tags: 0.0.3 → 0.0.4 - search-tickets: 0.0.6 → 0.0.7 - set-ticket-tags: 0.0.3 → 0.0.4 Sources: - locale-updated: 0.0.2 → 0.0.3 - new-ticket: 0.2.7 → 0.2.8 - new-ticket-comment-added: 0.0.2 → 0.0.3 - ticket-added-to-view: 0.0.7 → 0.0.8 - ticket-closed: 0.2.7 → 0.2.8 - ticket-pended: 0.2.7 → 0.2.8 - ticket-solved: 0.2.7 → 0.2.8 - ticket-updated: 0.2.7 → 0.2.8
|
@michelle0927 can I request a review from you for this please :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! LGTM! Ready for QA.
|
Hi everyone, all test cases are passed! Ready for release! |
Summary
Changes Made
1. Enhanced zendesk.app.mjs
assigneeIdprop definition with dynamic options loading agents withrole: "agent"filterassigneeEmailprop definition for direct email-based assignment2. Updated update-ticket.mjs component
assignee_idandassignee_emailfieldsFeatures
✅ Backward Compatible - All changes are optional and won't break existing workflows
✅ Flexible Assignment - Support for both ID-based and email-based assignment
✅ Dynamic Loading - Agent dropdown populated from actual Zendesk instance
✅ API Compliant - Uses correct Zendesk API v2 field names and data types
✅ Enhanced UX - Clear feedback when assignee changes are made
Summary by CodeRabbit
New Features
Chores