-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add Zendesk Help Center article search and retrieval actions #16978
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
- search-articles: Search help center articles by keywords and labels - get-article: Retrieve full article content by ID - list-help-center-sections: List all help center sections - list-articles-in-section: List articles within a specific section These actions enable access to Zendesk's Help Center knowledge base for knowledge management and customer support automation workflows.
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
@kevinschultz is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughFour new Zendesk action modules have been added: retrieving a specific article, listing articles in a section, listing help center sections, and searching articles. Each module defines input parameters, constructs API requests to the Zendesk Help Center, and returns the relevant data, including summary messages indicating the results. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ActionModule
participant ZendeskAPI
User->>ActionModule: Provide input parameters
ActionModule->>ZendeskAPI: Send API request with parameters
ZendeskAPI-->>ActionModule: Return data (article(s) or section(s))
ActionModule-->>User: Return results and summary
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/list-articles-in-section/list-articles-in-section.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/zendesk/actions/get-article/get-article.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/zendesk/actions/list-help-center-sections/list-help-center-sections.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ 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: 4
🧹 Nitpick comments (2)
components/zendesk/actions/search-articles/search-articles.mjs (1)
110-110
: Remove redundant comment.The comment is unnecessary and doesn't add value beyond what's already clear from the code structure.
-// This code defines a Pipedream action that allows users to search for articles in Zendesk's Help Center.
components/zendesk/actions/get-article/get-article.mjs (1)
79-79
: Remove redundant comment.The comment is unnecessary and doesn't add value beyond what's already clear from the action definition.
-// This code defines a Zendesk action to retrieve a specific help center article by its ID.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
components/zendesk/actions/get-article/get-article.mjs
(1 hunks)components/zendesk/actions/list-articles-in-section/list-articles-in-section.mjs
(1 hunks)components/zendesk/actions/list-help-center-sections/list-help-center-sections.mjs
(1 hunks)components/zendesk/actions/search-articles/search-articles.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
🔇 Additional comments (3)
components/zendesk/actions/list-articles-in-section/list-articles-in-section.mjs (1)
56-70
: LGTM - Clean API method implementation.The method correctly constructs the API request path and passes through parameters appropriately.
components/zendesk/actions/list-help-center-sections/list-help-center-sections.mjs (1)
50-63
: LGTM - Correct API endpoint and parameter handling.The method implementation is clean and follows the established pattern correctly.
components/zendesk/actions/get-article/get-article.mjs (1)
38-52
: LGTM - Clean implementation with proper error handling path.The method correctly constructs the API request with the article ID and handles parameters appropriately.
locale, | ||
sortBy, | ||
sortOrder, | ||
customSubdomain, | ||
} = this; | ||
|
||
const params = {}; | ||
|
||
if (sortBy) { | ||
params.sort_by = sortBy; | ||
} | ||
if (sortOrder) { | ||
params.sort_order = sortOrder; | ||
} |
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.
Fix missing locale parameter in API request.
The locale
parameter is extracted from props but never added to the params
object. This means the locale setting will be ignored in the API request.
Apply this diff to include the locale parameter:
const params = {};
+if (locale) {
+ params.locale = locale;
+}
if (sortBy) {
params.sort_by = sortBy;
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
locale, | |
sortBy, | |
sortOrder, | |
customSubdomain, | |
} = this; | |
const params = {}; | |
if (sortBy) { | |
params.sort_by = sortBy; | |
} | |
if (sortOrder) { | |
params.sort_order = sortOrder; | |
} | |
locale, | |
sortBy, | |
sortOrder, | |
customSubdomain, | |
} = this; | |
const params = {}; | |
if (locale) { | |
params.locale = locale; | |
} | |
if (sortBy) { | |
params.sort_by = sortBy; | |
} | |
if (sortOrder) { | |
params.sort_order = sortOrder; | |
} |
🤖 Prompt for AI Agents
In
components/zendesk/actions/list-articles-in-section/list-articles-in-section.mjs
around lines 75 to 88, the locale parameter is extracted but not added to the
params object, causing it to be omitted from the API request. To fix this, add a
condition to check if locale exists and then assign it to params.locale so the
API request includes the locale setting properly.
locale, | ||
sortBy, | ||
sortOrder, | ||
customSubdomain, | ||
} = this; | ||
|
||
const params = {}; | ||
|
||
if (sortBy) { | ||
params.sort_by = sortBy; | ||
} | ||
if (sortOrder) { | ||
params.sort_order = sortOrder; | ||
} |
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.
Fix missing locale parameter in API request.
Same issue as in the articles listing action - the locale
parameter is extracted but never added to the params
object.
Apply this diff to include the locale parameter:
const params = {};
+if (locale) {
+ params.locale = locale;
+}
if (sortBy) {
params.sort_by = sortBy;
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
locale, | |
sortBy, | |
sortOrder, | |
customSubdomain, | |
} = this; | |
const params = {}; | |
if (sortBy) { | |
params.sort_by = sortBy; | |
} | |
if (sortOrder) { | |
params.sort_order = sortOrder; | |
} | |
locale, | |
sortBy, | |
sortOrder, | |
customSubdomain, | |
} = this; | |
const params = {}; | |
if (locale) { | |
params.locale = locale; | |
} | |
if (sortBy) { | |
params.sort_by = sortBy; | |
} | |
if (sortOrder) { | |
params.sort_order = sortOrder; | |
} |
🤖 Prompt for AI Agents
In
components/zendesk/actions/list-help-center-sections/list-help-center-sections.mjs
around lines 67 to 80, the locale parameter is extracted but not added to the
params object sent in the API request. To fix this, add a condition to check if
locale is defined and then assign it to params.locale so that the API request
includes the locale parameter properly.
const { | ||
searchQuery, | ||
labelNames, | ||
sortBy, | ||
sortOrder, | ||
locale, | ||
customSubdomain, | ||
} = this; | ||
|
||
const params = {}; | ||
|
||
if (labelNames) { | ||
params.label_names = labelNames; | ||
} | ||
if (sortBy) { | ||
params.sort_by = sortBy; | ||
} | ||
if (sortOrder) { | ||
params.sort_order = sortOrder; | ||
} |
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.
Fix missing search query and locale parameters.
Two critical parameters are missing from the API request:
searchQuery
- the main search functionality is not implementedlocale
- extracted but not used
Apply this diff to include both parameters:
const params = {};
+if (searchQuery) {
+ params.query = searchQuery;
+}
if (labelNames) {
params.label_names = labelNames;
}
+if (locale) {
+ params.locale = locale;
+}
if (sortBy) {
params.sort_by = sortBy;
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const { | |
searchQuery, | |
labelNames, | |
sortBy, | |
sortOrder, | |
locale, | |
customSubdomain, | |
} = this; | |
const params = {}; | |
if (labelNames) { | |
params.label_names = labelNames; | |
} | |
if (sortBy) { | |
params.sort_by = sortBy; | |
} | |
if (sortOrder) { | |
params.sort_order = sortOrder; | |
} | |
const { | |
searchQuery, | |
labelNames, | |
sortBy, | |
sortOrder, | |
locale, | |
customSubdomain, | |
} = this; | |
const params = {}; | |
if (searchQuery) { | |
params.query = searchQuery; | |
} | |
if (labelNames) { | |
params.label_names = labelNames; | |
} | |
if (locale) { | |
params.locale = locale; | |
} | |
if (sortBy) { | |
params.sort_by = sortBy; | |
} | |
if (sortOrder) { | |
params.sort_order = sortOrder; | |
} |
🤖 Prompt for AI Agents
In components/zendesk/actions/search-articles/search-articles.mjs around lines
79 to 98, the API request parameters object is missing the critical searchQuery
and locale parameters. To fix this, add searchQuery as a parameter named 'query'
and locale as 'locale' to the params object, ensuring both are included in the
API request payload to enable proper search functionality and locale filtering.
const { | ||
articleId, | ||
locale, | ||
includeTranslations, | ||
customSubdomain, | ||
} = this; | ||
|
||
const params = {}; | ||
|
||
if (includeTranslations) { | ||
params.include = "translations"; | ||
} |
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.
Fix missing locale parameter in API request.
The locale
parameter is extracted but never added to the params
object, following the same pattern as the other actions.
Apply this diff to include the locale parameter:
const params = {};
+if (locale) {
+ params.locale = locale;
+}
if (includeTranslations) {
params.include = "translations";
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const { | |
articleId, | |
locale, | |
includeTranslations, | |
customSubdomain, | |
} = this; | |
const params = {}; | |
if (includeTranslations) { | |
params.include = "translations"; | |
} | |
const { | |
articleId, | |
locale, | |
includeTranslations, | |
customSubdomain, | |
} = this; | |
const params = {}; | |
if (locale) { | |
params.locale = locale; | |
} | |
if (includeTranslations) { | |
params.include = "translations"; | |
} |
🤖 Prompt for AI Agents
In components/zendesk/actions/get-article/get-article.mjs around lines 55 to 66,
the locale parameter is extracted but not added to the params object for the API
request. To fix this, add a line to include locale in the params object, similar
to how includeTranslations is handled, ensuring the locale is passed correctly
in the API call.
Adds four actions based off of the Zendesk API docs, following the format of the existing actions. The current actions are for tickets only, these are for knowledge articles.
These actions enable access to Zendesk's Help Center knowledge base for knowledge workflows.
WHY
I want to leverage Zendesk article content in my workflows. The current integration only considers tickets.
These API docs were used to develop:
https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#show-article
https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#list-articles
Summary by CodeRabbit