-
Couldn't load subscription status.
- Fork 5.5k
Add Set Custom Ticket Fields action for Zendesk #18502
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
Add Set Custom Ticket Fields action for Zendesk #18502
Conversation
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 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
WalkthroughAdds 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 Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs (1)
⏰ 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)
🔇 Additional comments (7)
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. Comment |
|
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
🧹 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
📒 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
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: 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.idandfield.value === undefinedbut doesn't verifyfield.idis 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
📒 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
parseObjectcall on array elements properly handles nested arrays and objects.
15-22: Object transformation logic is sound.The
Object.entries→map→Object.fromEntriespattern 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.updatewith the ticket path and spreads additional arguments for flexibility.
60-69: API call structure looks correct.The
updateTicketcall properly passesstep,ticketId,customSubdomain, and wraps custom fields indata.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; usingtype: "string[]"and parsing each JSON string is the correct workaround.
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs
Show resolved
Hide resolved
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs
Show resolved
Hide resolved
components/zendesk/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs
Show resolved
Hide resolved
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.
Ready for QA!
|
Hi everyone, all test cases are passed! Ready for release! |
Summary
Added new action to set one or more custom field values on a Zendesk ticket using the Zendesk API.
Features
idandvaluepropertiesTest plan
sc_JDi80Zjp)zendesk.app.mjs,common/constants.mjs)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Error Handling
Chores