Skip to content

Conversation

@seynadio
Copy link
Contributor

@seynadio seynadio commented Sep 4, 2025

Summary

  • Add assigneeId prop with dynamic agent dropdown selection from Zendesk
  • Add assigneeEmail prop for email-based ticket assignment
  • Update ticket data construction to include assignee_id and assignee_email API fields
  • Enhanced summary messages to reflect assignee updates

Changes Made

1. Enhanced zendesk.app.mjs

  • Added assigneeId prop definition with dynamic options loading agents with role: "agent" filter
  • Added assigneeEmail prop definition for direct email-based assignment
  • Both props are optional to maintain backward compatibility

2. Updated update-ticket.mjs component

  • Added assignee props to component interface
  • Modified ticket data construction to conditionally include assignee fields
  • Enhanced summary messaging to indicate when assignee has been updated
  • Follows Zendesk API v2 specification using assignee_id and assignee_email fields

Features

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

    • Attach files to Zendesk tickets and include them in comments.
    • Assign tickets to agents by ID or email when updating a ticket.
    • Enhanced update summaries indicating attachments and assignee details.
    • Multi-file upload support with robust error handling.
  • Chores

    • Version bumps across multiple Zendesk actions and sources.
    • Updated dependencies to improve stability and compatibility.

seynadio and others added 11 commits August 19, 2025 08:08
- 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]>
@vercel
Copy link

vercel bot commented Sep 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Sep 4, 2025 11:05am
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 4, 2025 11:05am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

Caution

Review failed

Failed to post review comments.

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6aeaea6 and fe16ca0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs (1 hunks)
  • components/zendesk/actions/create-ticket/create-ticket.mjs (1 hunks)
  • components/zendesk/actions/delete-ticket/delete-ticket.mjs (1 hunks)
  • components/zendesk/actions/get-ticket-info/get-ticket-info.mjs (1 hunks)
  • components/zendesk/actions/get-user-info/get-user-info.mjs (1 hunks)
  • components/zendesk/actions/list-locales/list-locales.mjs (1 hunks)
  • components/zendesk/actions/list-macros/list-macros.mjs (1 hunks)
  • components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs (1 hunks)
  • components/zendesk/actions/list-tickets/list-tickets.mjs (1 hunks)
  • components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs (1 hunks)
  • components/zendesk/actions/search-tickets/search-tickets.mjs (1 hunks)
  • components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs (1 hunks)
  • components/zendesk/actions/update-ticket/update-ticket.mjs (5 hunks)
  • components/zendesk/package.json (2 hunks)
  • components/zendesk/sources/locale-updated/locale-updated.mjs (1 hunks)
  • components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (1 hunks)
  • components/zendesk/sources/new-ticket/new-ticket.mjs (1 hunks)
  • components/zendesk/sources/ticket-added-to-view/ticket-added-to-view.mjs (1 hunks)
  • components/zendesk/sources/ticket-closed/ticket-closed.mjs (1 hunks)
  • components/zendesk/sources/ticket-pended/ticket-pended.mjs (1 hunks)
  • components/zendesk/sources/ticket-solved/ticket-solved.mjs (1 hunks)
  • components/zendesk/sources/ticket-updated/ticket-updated.mjs (1 hunks)
  • components/zendesk/zendesk.app.mjs (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/zendesk/package.json
🧬 Code graph analysis (1)
components/zendesk/actions/update-ticket/update-ticket.mjs (4)
components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs (1)
  • response (38-43)
components/zendesk/actions/create-ticket/create-ticket.mjs (1)
  • response (59-72)
components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs (1)
  • response (38-43)
components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs (1)
  • response (37-42)

Walkthrough

This 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

Cohort / File(s) Summary of changes
Action version bumps
components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs, .../create-ticket/create-ticket.mjs, .../delete-ticket/delete-ticket.mjs, .../get-ticket-info/get-ticket-info.mjs, .../get-user-info/get-user-info.mjs, .../list-locales/list-locales.mjs, .../list-macros/list-macros.mjs, .../list-ticket-comments/list-ticket-comments.mjs, .../list-tickets/list-tickets.mjs, .../remove-ticket-tags/remove-ticket-tags.mjs, .../search-tickets/search-tickets.mjs, .../set-ticket-tags/set-ticket-tags.mjs
Patch version fields updated; no logic/behavior changes.
Update Ticket enhancements
components/zendesk/actions/update-ticket/update-ticket.mjs
Adds attachments, assigneeId, assigneeEmail props; uploads attachments and attaches tokens to comment; supports assignee update; reworks payload via ticketData; updates description; bumps version to 0.2.0; augments summary.
Zendesk app: uploads and assignee props
components/zendesk/zendesk.app.mjs
Adds propDefinitions: attachments, assigneeId (with async options), assigneeEmail. Adds methods: streamToBuffer, uploadFile, uploadFiles. Implements multi-file upload and error handling.
Sources version bumps
components/zendesk/sources/locale-updated/locale-updated.mjs, .../new-ticket-comment-added/new-ticket-comment-added.mjs, .../new-ticket/new-ticket.mjs, .../ticket-added-to-view/ticket-added-to-view.mjs, .../ticket-closed/ticket-closed.mjs, .../ticket-pended/ticket-pended.mjs, .../ticket-solved/ticket-solved.mjs, .../ticket-updated/ticket-updated.mjs
Patch version fields updated; no logic/behavior changes.
Package metadata
components/zendesk/package.json
Bumps package version to 0.8.2; upgrades @pipedream/platform to ^3.1.0; adds dependency path ^0.12.7.

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
Loading
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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • luancazarine
  • jcortes

Poem

A nibble of versions, hop-hop they rise,
New tricks for tickets, with files as surprise.
Assign with an email, or agent ID—
I staple the uploads, proud as can be.
Thump-thump, ship it! 🐇📎✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Sep 4, 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:

- 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
@seynadio
Copy link
Contributor Author

seynadio commented Sep 4, 2025

@michelle0927 can I request a review from you for this please :)

Copy link
Collaborator

@michelle0927 michelle0927 left a 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.

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/Add-assignee-support-to-Zendesk-update-ticket-component-264bf548bb5e811badb5c87a14ba1590

@vunguyenhung vunguyenhung merged commit 201c939 into PipedreamHQ:master Sep 6, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Release to Done in Component (Source and Action) Backlog Sep 6, 2025
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

Development

Successfully merging this pull request may close these issues.

6 participants