-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add ticket tag management to Zendesk integration #17609
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
- Add ticketTags prop definition to Zendesk app with JSDoc documentation - Add tag management methods: setTicketTags, addTicketTags, removeTicketTags - Enhance update-ticket action with tag support: * Add ticketTags and tagAction props * Support set/add/remove tag operations * Update summary and response format with tag operation details - Add dedicated tag management actions: * set-ticket-tags: Replace all existing tags * add-ticket-tags: Append to existing tags * remove-ticket-tags: Remove specific tags - Follow Zendesk Tags API specification (/tickets/{id}/tags.json) - Support custom subdomain for Enterprise accounts
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:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
WalkthroughZendesk integration is expanded with new functionality for managing ticket tags. Three new action modules—add, remove, and set ticket tags—are introduced. The main Zendesk app gains corresponding methods for these actions. Additionally, the ticket update action now supports optional tag operations, allowing tags to be set, added, or removed during ticket updates. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action (add/set/remove/update)
participant Zendesk App
participant Zendesk API
User->>Action (add/set/remove/update): Provide ticketId, tags, (tagAction)
Action (add/set/remove/update)->>Zendesk App: Call method (addTicketTags/setTicketTags/removeTicketTags)
Zendesk App->>Zendesk API: Send HTTP request to /tickets/{ticketId}/tags.json
Zendesk API-->>Zendesk App: Return API response
Zendesk App-->>Action (add/set/remove/update): Return result
Action (add/set/remove/update)-->>User: Return summary and response
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/zendesk/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/zendesk/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 components/zendesk/actions/remove-ticket-tags/remove-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
✨ 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. |
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
🧹 Nitpick comments (1)
components/zendesk/actions/update-ticket/update-ticket.mjs (1)
134-142
: Simplify the switch statement to remove redundant case.The static analysis tool correctly identified that the
case "set":
clause is redundant since the default case handles the same logic.Apply this diff to remove the redundant case:
- case "set": - default: - tagResponse = await this.app.setTicketTags({ - step, - ticketId, - tags: ticketTags, - customSubdomain, - }); - break; + default: + tagResponse = await this.app.setTicketTags({ + step, + ticketId, + tags: ticketTags, + customSubdomain, + }); + break;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs
(1 hunks)components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs
(1 hunks)components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs
(1 hunks)components/zendesk/actions/update-ticket/update-ticket.mjs
(4 hunks)components/zendesk/zendesk.app.mjs
(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/zendesk/actions/update-ticket/update-ticket.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
🪛 Biome (1.9.4)
components/zendesk/actions/update-ticket/update-ticket.mjs
[error] 134-134: Useless case clause.
because the default clause is present:
Unsafe fix: Remove the useless case.
(lint/complexity/noUselessSwitchCase)
🔇 Additional comments (8)
components/zendesk/zendesk.app.mjs (2)
177-182
: Well-implemented prop definition for ticket tags.The
ticketTags
prop definition is correctly structured as a string array with appropriate labeling and description. The optional flag and clear description about replacing existing tags will help users understand the behavior.
309-371
: Excellent implementation of tag management methods.The three new tag management methods are well-implemented with several strengths:
- Proper JSDoc documentation with clear parameter descriptions
- Correct HTTP methods (PUT for set, POST for add, DELETE for remove)
- Consistent API endpoint pattern
/tickets/${ticketId}/tags.json
- Support for custom subdomain for enterprise accounts
- Proper data structure with
{ tags }
payload- Consistent parameter destructuring and use of the existing
makeRequest
patternThe implementation follows Zendesk API v2 specifications and maintains consistency with the existing codebase patterns.
components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs (1)
1-48
: Well-structured action for removing ticket tags.The action implementation follows Pipedream conventions correctly:
- Proper key naming following the
zendesk-remove-ticket-tags
pattern- Correct use of prop definitions with appropriate description override for the removal context
- Clean async run method that calls the app's
removeTicketTags
method- Well-formatted summary message indicating the number of tags removed
- Appropriate documentation link to Zendesk API reference
The implementation is consistent with the other tag management actions in this PR.
components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs (1)
1-47
: Consistent implementation for setting ticket tags.The action follows the established patterns correctly:
- Proper action key and naming convention
- Appropriate use of prop definitions (ticketTags description already covers the "replace" behavior)
- Clean implementation calling the app's
setTicketTags
method- Well-formatted summary message
- Correct documentation link to Zendesk API
The implementation is consistent with the other tag management actions introduced in this PR.
components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs (1)
1-48
: Thoughtful implementation for adding ticket tags.The action is well-implemented with attention to detail:
- Proper action key following naming conventions
- Thoughtful description override for
ticketTags
prop to clarify the append behavior- Correct method call to
addTicketTags
- Appropriate summary message using "added" terminology
- Consistent structure with other tag management actions
- Proper documentation link
The description override is particularly valuable as it helps users understand the difference between this action and the set-ticket-tags action.
components/zendesk/actions/update-ticket/update-ticket.mjs (3)
6-8
: Good enhancement to support tag management.The description and version updates appropriately reflect the new tag management capabilities added to the action.
47-73
: Well-designed props for tag management.The new props are well-structured:
ticketTags
properly uses the app's prop definitiontagAction
provides clear options with descriptive labels- Default value of "set" is appropriate for backward compatibility
- The optional nature allows existing users to continue using the action without changes
113-158
: Excellent integration of tag management with ticket updates.The tag handling logic is well-implemented:
- Proper conditional check for tag presence
- Correct method calls for each tag action
- Informative summary messages that include tag operation details
- Appropriate return structure with both ticket and tag responses
- Clean separation between tag and non-tag execution paths
The implementation enhances the existing functionality without breaking existing usage patterns.
Summary
Complete ticket tag management functionality for Zendesk, enabling comprehensive tag operations for better ticket organization and workflow automation.
New Actions (3 total)
Enhanced Actions
ticketTags
prop: Array of tags to managetagAction
prop: Choose between set/add/remove operationsEnhanced Infrastructure
setTicketTags()
: PUT/tickets/{id}/tags.json
- Replace all tagsaddTicketTags()
: POST/tickets/{id}/tags.json
- Append tagsremoveTicketTags()
: DELETE/tickets/{id}/tags.json
- Remove specific tagsFeatures
Test plan
API Usage
Uses Zendesk Tags API v2 endpoints:
/api/v2/tickets/{id}/tags.json
(Set/Replace tags)/api/v2/tickets/{id}/tags.json
(Add tags)/api/v2/tickets/{id}/tags.json
(Remove tags)Perfect for ticket organization, automated tagging workflows, and bulk tag management operations!
Summary by CodeRabbit
New Features
Improvements