Skip to content

Conversation

@Afstkla
Copy link
Contributor

@Afstkla Afstkla commented Sep 30, 2025

Summary

Added new action to set one or more custom field values on a Zendesk ticket using the Zendesk API.

Features

  • Supports setting multiple custom fields in a single action
  • Accepts array of custom field objects with id and value properties
  • Includes validation for required properties
  • Supports custom subdomain for enterprise accounts

Test plan

  • Published action to Pipedream (component ID: sc_JDi80Zjp)
  • Action successfully packages with dependencies (zendesk.app.mjs, common/constants.mjs)
  • Manual testing in Pipedream workflow
image

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a “Set Custom Ticket Fields” Zendesk action to update one or more custom ticket fields.
    • Accepts inputs as JSON strings or objects (normalizes nested structures) and supports specifying a subdomain.
    • Returns a concise success summary with updated field count and ticket ID.
  • Error Handling

    • Validates each field includes both id and value and returns descriptive errors for invalid/malformed input.
  • Chores

    • Bumped Zendesk component version to 0.10.0

Added new action to set one or more custom field values on a Zendesk ticket using the Zendesk API.

Features:
- Supports setting multiple custom fields in a single action
- Accepts array of custom field objects with id and value properties
- Includes validation for required properties
- Supports custom subdomain for enterprise accounts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Sep 30, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 1, 2025 3:25pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Adds a new Zendesk action to set custom ticket fields (parses/validates input and calls app.update to PATCH /tickets/{ticketId}), a recursive parseObject utility, and bumps components/zendesk package version.

Changes

Cohort / File(s) Change Summary
Zendesk Action: Set Custom Ticket Fields
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs
New action module exporting metadata (key, name, description, type, version), props (app, ticketId, customFields, customSubdomain), helper updateTicket, and run({ $: step }) which uses parseObject to normalize customFields, validates each field has id and value, calls app.update to patch ticket.custom_fields, and sets a step summary with updated count and ticket id.
Utility: parseObject
components/zendesk/common/utils.mjs
New parseObject(obj) utility to recursively normalize inputs: handles falsy, string (JSON parse with fallback), arrays (maps), plain objects (recursively parses values), and other types.
Package version bump
components/zendesk/package.json
Updated version from 0.9.0 to 0.10.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant W as Workflow/Caller
  participant A as Action: SetCustomTicketFields
  participant U as Utils: parseObject
  participant Z as Zendesk App (app.update)

  W->>A: run({ $: step, ticketId, customFields, customSubdomain })
  A->>U: parseObject(customFields)
  U-->>A: normalized customFields (array/object)
  A->>A: validate each item has `id` and `value`
  alt validation OK
    A->>Z: app.update PATCH /tickets/{ticketId} { ticket: { custom_fields: [...] } }
    Z-->>A: response (updated ticket)
    A->>A: set step.summary("Updated N custom field(s) on ticket ID")
    A-->>W: return response
  else validation error
    A-->>W: throw validation error
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through fields of tickets bright,
I parse their shapes by lantern light,
I nudge a value, gentle, neat,
I patch, I stamp — the ticket's complete. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description does not follow the repository’s required template because it lacks the mandatory “## WHY” section, instead including “## Summary,” “## Features,” and “## Test plan” headings that do not satisfy the template’s structure. Please update the description to include a “## WHY” section summarizing the motivation for this change and align the heading structure to match the repository’s template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly summarizes the main change by indicating the addition of a “Set Custom Ticket Fields” action for the Zendesk integration, which matches the changeset’s primary goal of introducing a new Zendesk action module.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 37750bc and 796fb65.

📒 Files selected for processing (1)
  • components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs (1)
components/zendesk/common/utils.mjs (2)
  • parseObject (1-25)
  • parseObject (1-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (7)
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs (7)

1-3: LGTM!

Imports are appropriate. ConfigurationError from @pipedream/platform is the correct error type for user-facing validation errors, and parseObject is correctly imported from the utility module.


5-10: LGTM!

Action metadata follows Pipedream conventions. The key uses proper kebab-case naming, and the description includes API documentation reference.


31-40: LGTM!

The updateTicket helper method is cleanly implemented. It properly delegates to app.update with the correct path construction and argument spreading.


48-53: Good addition of array validation.

The array type guard correctly addresses the previous review concern. Using ConfigurationError provides a clear user-facing message if parseObject returns an unexpected type.


56-63: Field validation logic is sound.

The validation correctly checks for required id and value properties. Note that line 60 uses === undefined rather than a falsy check, which intentionally permits null, 0, false, or empty string as valid field values—this is appropriate for custom field flexibility.


65-74: LGTM!

The updateTicket call correctly passes all required context (step, ticketId, customSubdomain) and structures the payload properly with ticket.custom_fields.


78-78: LGTM!

Returning the full response allows downstream steps to access additional ticket data if needed.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Sep 30, 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
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/package.json (1)

3-3: Consider a minor version bump instead of a patch.

Adding a new action ("Set Custom Ticket Fields") introduces new functionality, which typically warrants a minor version bump (0.9.0 → 0.10.0) rather than a patch version bump (0.9.0 → 0.9.1). Patch versions are conventionally reserved for backwards-compatible bug fixes per semantic versioning guidelines.

Apply this diff to use a minor version bump:

-  "version": "0.9.1",
+  "version": "0.10.0",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea5db68 and c2c2b7a.

📒 Files selected for processing (1)
  • components/zendesk/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components

@GTFalcao GTFalcao moved this to Ready for PR Review in Component (Source and Action) Backlog Sep 30, 2025
@michelle0927 michelle0927 removed the request for review from jcortes September 30, 2025 15:54
@michelle0927 michelle0927 moved this from Ready for PR Review to Doing in Component (Source and Action) Backlog Sep 30, 2025
@michelle0927 michelle0927 moved this from Doing to Ready for PR Review in Component (Source and Action) Backlog Sep 30, 2025
@vunguyenhung vunguyenhung moved this from Ready for PR Review to Ready for QA in Component (Source and Action) Backlog Oct 1, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to Ready for PR Review in Component (Source and Action) Backlog Oct 1, 2025
@michelle0927 michelle0927 moved this from Ready for PR Review to In Review in Component (Source and Action) Backlog Oct 1, 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: 4

🧹 Nitpick comments (1)
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs (1)

51-58: Strengthen validation for field properties.

The validation checks field.id and field.value === undefined but doesn't verify field.id is a non-empty string or number. Consider:

     parsedCustomFields.forEach((field, index) => {
-      if (!field.id) {
+      if (field.id == null || field.id === "") {
         throw new Error(`Custom field at index ${index} is missing required "id" property`);
       }
-      if (field.value === undefined) {
+      if (field.value == null) {
         throw new Error(`Custom field at index ${index} is missing required "value" property`);
       }
     });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2c2b7a and 37750bc.

📒 Files selected for processing (3)
  • components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs (1 hunks)
  • components/zendesk/common/utils.mjs (1 hunks)
  • components/zendesk/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/zendesk/package.json
🧰 Additional context used
🧬 Code graph analysis (2)
components/zendesk/common/utils.mjs (1)
components/akeneo/akeneo.app.mjs (1)
  • JSON (99-110)
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs (1)
components/zendesk/common/utils.mjs (2)
  • parseObject (1-25)
  • parseObject (1-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
🔇 Additional comments (8)
components/zendesk/common/utils.mjs (3)

5-10: Consider whether non-JSON strings should be preserved.

Lines 8-9 silently catch parse failures and return the original string. This is reasonable for user input that might be either JSON or plain text, but verify this behavior aligns with the action's requirements.


12-13: Array recursion handles nested structures correctly.

The recursive parseObject call on array elements properly handles nested arrays and objects.


15-22: Object transformation logic is sound.

The Object.entriesmapObject.fromEntries pattern correctly recurses into nested object values.

components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs (5)

1-9: Component metadata follows Pipedream guidelines.

The key format, type, version, and documentation link align with the project standards mentioned in the PR objectives.


30-38: updateTicket wrapper is correctly implemented.

The method properly delegates to app.update with the ticket path and spreads additional arguments for flexibility.


60-69: API call structure looks correct.

The updateTicket call properly passes step, ticketId, customSubdomain, and wraps custom fields in data.ticket.custom_fields, matching the Zendesk API structure.


73-73: Return statement provides full response.

Returning the complete API response gives users access to all ticket data, which is appropriate for an action component.


19-21: No change needed – object[] isn’t supported
Pipedream doesn’t support array-of-objects prop types; using type: "string[]" and parsing each JSON string is the correct workaround.

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.

Ready for QA!

@michelle0927 michelle0927 moved this from In Review to Ready for QA in Component (Source and Action) Backlog Oct 1, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to Ready for Release in Component (Source and Action) Backlog Oct 1, 2025
@vunguyenhung
Copy link
Collaborator

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

Test report
https://vunguyenhung.notion.site/Add-Set-Custom-Ticket-Fields-action-for-Zendesk-27fbf548bb5e819daf4ce2760acee889

@vunguyenhung vunguyenhung merged commit d34e972 into PipedreamHQ:master Oct 1, 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 Oct 1, 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.

5 participants