-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add comprehensive tag management for Freshdesk tickets #17610
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
base: master
Are you sure you want to change the base?
Conversation
- Added ticketTags prop definition to freshdesk.app.mjs - Added 3 tag management methods: setTicketTags, addTicketTags, removeTicketTags - Created 3 dedicated tag actions: set-ticket-tags, add-ticket-tags, remove-ticket-tags - Enhanced update-ticket action with tag support - Provides feature parity with Zendesk tag management 🤖 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 Git ↗︎ 1 Skipped Deployment
|
WalkthroughNew functionality for managing Freshdesk ticket tags was introduced. This includes app methods to set, add, and remove tags on tickets, along with corresponding action modules for each operation. The update-ticket action now supports setting ticket tags. All changes extend the Freshdesk integration with comprehensive tag management capabilities. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ActionModule
participant FreshdeskApp
participant FreshdeskAPI
User->>ActionModule: Trigger (add/remove/set) ticket tags
ActionModule->>FreshdeskApp: Call corresponding method (addTicketTags/removeTicketTags/setTicketTags)
FreshdeskApp->>FreshdeskAPI: Fetch current ticket (if needed)
FreshdeskAPI-->>FreshdeskApp: Return ticket data
FreshdeskApp->>FreshdeskAPI: Update ticket tags (PUT request)
FreshdeskAPI-->>FreshdeskApp: Confirm update
FreshdeskApp-->>ActionModule: Return result
ActionModule-->>User: Show summary message
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/freshdesk/actions/add-ticket-tags/add-ticket-tags.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/freshdesk/actions/set-ticket-tags/set-ticket-tags.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/freshdesk/actions/update-ticket/update-ticket.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@seynadio is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
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.
Actionable comments posted: 0
♻️ Duplicate comments (1)
components/freshdesk/actions/set-ticket-tags/set-ticket-tags.mjs (1)
31-33
: Consistent validation pattern across tag actions.The validation follows the same pattern as the other tag actions, which is good for consistency. The same suggestion about shared validation utility applies here as well.
🧹 Nitpick comments (3)
components/freshdesk/freshdesk.app.mjs (1)
119-124
: Consider adding client-side validation for tag length constraint.The property description mentions "32 characters or less" but there's no validation to enforce this constraint. Consider adding validation to prevent API errors.
ticketTags: { type: "string[]", label: "Tags", description: "Array of tags to apply to the ticket. Each tag must be 32 characters or less.", optional: true, + validate: (tags) => { + if (!Array.isArray(tags)) return true; + const invalidTags = tags.filter(tag => typeof tag !== 'string' || tag.length > 32); + if (invalidTags.length > 0) { + throw new Error(`Invalid tags: ${invalidTags.join(', ')}. Each tag must be a string of 32 characters or less.`); + } + return true; + }, },components/freshdesk/actions/remove-ticket-tags/remove-ticket-tags.mjs (1)
31-33
: Consider enhancing validation for better user experience.The validation checks for empty arrays but doesn't validate individual tag values. Consider adding validation for empty strings or invalid characters.
if (!ticketTags || ticketTags.length === 0) { throw new Error("At least one tag must be provided"); } + +// Validate individual tags +const invalidTags = ticketTags.filter(tag => !tag || typeof tag !== 'string' || tag.trim().length === 0); +if (invalidTags.length > 0) { + throw new Error("All tags must be non-empty strings"); +}components/freshdesk/actions/add-ticket-tags/add-ticket-tags.mjs (1)
31-33
: Consider consistent validation across all tag actions.The validation logic is identical to the remove action, which is good for consistency. However, consider extracting this validation into a shared utility function to reduce code duplication.
In a shared utility file:
export function validateTags(tags, operationName) { if (!tags || tags.length === 0) { throw new Error(`At least one tag must be provided for ${operationName}`); } const invalidTags = tags.filter(tag => !tag || typeof tag !== 'string' || tag.trim().length === 0); if (invalidTags.length > 0) { throw new Error("All tags must be non-empty strings"); } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
components/freshdesk/actions/add-ticket-tags/add-ticket-tags.mjs
(1 hunks)components/freshdesk/actions/remove-ticket-tags/remove-ticket-tags.mjs
(1 hunks)components/freshdesk/actions/set-ticket-tags/set-ticket-tags.mjs
(1 hunks)components/freshdesk/actions/update-ticket/update-ticket.mjs
(1 hunks)components/freshdesk/freshdesk.app.mjs
(2 hunks)
🔇 Additional comments (7)
components/freshdesk/freshdesk.app.mjs (3)
275-293
: Well-implemented method with proper documentation.The
setTicketTags
method correctly replaces all existing tags on a ticket with the provided array. The JSDoc documentation is clear and the implementation is straightforward.
301-317
: Excellent implementation with proper duplicate handling.The
addTicketTags
method correctly fetches current tags and merges them with new tags usingSet
for deduplication. The logic is sound and handles edge cases properly.
325-342
: Solid implementation with efficient filtering.The
removeTicketTags
method efficiently filters out specified tags usingSet
for optimal lookup performance. The implementation correctly handles the case where some tags to remove may not exist.components/freshdesk/actions/update-ticket/update-ticket.mjs (1)
93-99
: Clean integration of tag management into update action.The
tags
property is properly integrated using theticketTags
prop definition from the app. The description clearly communicates that this will replace all existing tags, which is consistent with the underlying API behavior.components/freshdesk/actions/remove-ticket-tags/remove-ticket-tags.mjs (1)
35-42
: Well-structured action with clear feedback.The action properly calls the app method and provides clear feedback via the summary message. The implementation is consistent with other actions in the codebase.
components/freshdesk/actions/add-ticket-tags/add-ticket-tags.mjs (1)
35-42
: Consistent implementation with appropriate feedback.The action correctly calls the app's
addTicketTags
method and provides clear user feedback. The implementation maintains consistency with other tag actions.components/freshdesk/actions/set-ticket-tags/set-ticket-tags.mjs (1)
35-42
: Clean implementation completing the tag management suite.The action properly implements the set/replace functionality and provides clear feedback. Combined with the add and remove actions, this completes a comprehensive tag management system for Freshdesk tickets.
Summary
Summary by CodeRabbit
New Features
Improvements