-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Zendesk - Added the ability to set tags on a ticket when updating #17134
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
@RoyHP is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes introduce a new optional Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UpdateTicketAction
participant ZendeskAPI
User->>UpdateTicketAction: Provide ticket update details (including optional tags)
UpdateTicketAction->>ZendeskAPI: Send update request with ticket fields and tags
ZendeskAPI-->>UpdateTicketAction: Respond with update result
UpdateTicketAction-->>User: Return 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/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 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ 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 (
|
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/actions/update-ticket/update-ticket.mjs (1)
64-88
: Build the ticket payload dynamically to avoid unintentionally clearing fieldsWhen a prop is omitted by the user the current implementation still sends it as
undefined
(or an empty object forcomment
), which may overwrite existing values or raise validation errors.A concise pattern prevents that:
- const response = await this.updateTicket({ + const ticket = { + ...(ticketCommentBody && { comment: { body: ticketCommentBody } }), + ...(ticketPriority && { priority: ticketPriority }), + ...(ticketSubject && { subject: ticketSubject }), + ...(ticketStatus && { status: ticketStatus }), + ...(tags?.length && { tags }), + }; + + const response = await this.updateTicket({ step, ticketId, customSubdomain, data: { - ticket: { - comment: { - body: ticketCommentBody, - }, - priority: ticketPriority, - subject: ticketSubject, - status: ticketStatus, - tags: tags, - }, + ticket, }, });Besides preventing accidental data loss, this keeps the request body minimal and easier to read.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/zendesk/actions/update-ticket/update-ticket.mjs
(4 hunks)components/zendesk/zendesk.app.mjs
(1 hunks)
🔇 Additional comments (1)
components/zendesk/zendesk.app.mjs (1)
147-152
: ```shell
#!/bin/bashLocate the Zendesk app file
file=$(fd zendesk.app.mjs)
echo "Inspecting: $file"Show the lines around the
tags
propertyrg -n "tags:" -C5 "$file"
Check for any existing validate() implementations in this file
rg -n "validate" "$file"
</details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
I agree with this change and have implemented it, with the exception that we check if tags is undefined instead of using tags?.length -- otherwise, it would not be possible to delete the tags on a ticket, as the Zendesk API requires receiving a null or empty array value for that key in order to delete them. |
This is ready for review. Please let me know if I've missed any other steps that should be taken for contributing. Our team needs this functionality in order to continue using pipedream. |
This is a minor update which adds the ability to specify the
tags
to apply to a Zendesk ticket when performing an update operation on that ticket. I have added it to the existingupdateTicket
method, per their documentation: https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticketSummary by CodeRabbit