Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seynadio
Copy link

@seynadio seynadio commented Jul 14, 2025

Summary

Complete ticket tag management functionality for Zendesk, enabling comprehensive tag operations for better ticket organization and workflow automation.

New Actions (3 total)

  • set-ticket-tags: Replace all existing tags on a ticket with specified tags
  • add-ticket-tags: Append new tags to existing tags (non-destructive)
  • remove-ticket-tags: Remove specific tags while preserving others

Enhanced Actions

  • update-ticket: Now supports tag management during ticket updates
    • New ticketTags prop: Array of tags to manage
    • New tagAction prop: Choose between set/add/remove operations
    • Enhanced response includes both ticket and tag operation results
    • Improved summary shows tag operation details

Enhanced Infrastructure

  • zendesk.app.mjs: Added ticketTags prop definition and 3 tag management methods with JSDoc
    • setTicketTags(): PUT /tickets/{id}/tags.json - Replace all tags
    • addTicketTags(): POST /tickets/{id}/tags.json - Append tags
    • removeTicketTags(): DELETE /tickets/{id}/tags.json - Remove specific tags

Features

  • Full API compliance: Uses Zendesk Tags API specification
  • Custom subdomain support: Enterprise Zendesk accounts can specify subdomains
  • Flexible tag operations: Set (replace), add (append), or remove tags
  • Enhanced user experience: Clear summaries and detailed responses
  • Proper validation: Input validation and error handling

Test plan

  • Test all 3 dedicated tag actions with various tag scenarios
  • Test enhanced update-ticket action with tag operations
  • Test custom subdomain functionality for Enterprise accounts
  • Validate API endpoints match Zendesk specification
  • Test prop definitions and dynamic options loading
  • Remove accidental Freshdesk changes from original PR

API Usage

Uses Zendesk Tags API v2 endpoints:

  • PUT /api/v2/tickets/{id}/tags.json (Set/Replace tags)
  • POST /api/v2/tickets/{id}/tags.json (Add tags)
  • DELETE /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

    • Added the ability to set, add, or remove tags on Zendesk tickets.
    • Introduced new actions for managing ticket tags directly within the Zendesk integration.
    • Enhanced ticket update functionality to support tag operations with flexible options.
  • Improvements

    • Updated descriptions and summaries to reflect new tag management capabilities.

- 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
@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Jul 14, 2025
@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

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:

Copy link

vercel bot commented Jul 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 14, 2025 11:52am

Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

Walkthrough

Zendesk 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

File(s) Change Summary
components/zendesk/zendesk.app.mjs Added ticketTags prop definition; introduced setTicketTags, addTicketTags, and removeTicketTags methods.
components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs New action to add tags to a Zendesk ticket using the app's addTicketTags method.
components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs New action to remove tags from a Zendesk ticket using the app's removeTicketTags method.
components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs New action to set (replace) all tags on a Zendesk ticket using the app's setTicketTags method.
components/zendesk/actions/update-ticket/update-ticket.mjs Enhanced to support tag management: added ticketTags and tagAction props, updated logic to handle tag actions.

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
Loading

Poem

In the warren of code, new tags now hop,
Add, set, or remove—no need to stop!
Tickets in Zendesk, spruced up with flair,
Rabbits rejoice, tags everywhere!
With every update, the garden grows bright—
Hop on, dear devs, your tags set right!
🐇✨

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/zendesk/actions/update-ticket/update-ticket.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

  • 2 others
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

vercel bot commented Jul 14, 2025

@seynadio is attempting to deploy a commit to the Pipedreamers Team on Vercel.

A member of the Team first needs to authorize it.

@seynadio seynadio mentioned this pull request Jul 14, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between e21d334 and f5a832b.

📒 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 pattern

The 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 definition
  • tagAction 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User submitted Submitted by a user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants