Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Nov 26, 2025

Resolves #19164 and #19165

Summary by CodeRabbit

  • New Features

    • Added actions: Get Article, Get Macro, List Active Macros, List Articles
    • Added locale-aware article/macro listing and retrieval plus new locale/article/macro selection options
    • Added ability to list active macros and new access/include option constants
  • Chores

    • Bumped package and numerous component/action/source versions across the Zendesk integration

✏️ Tip: You can customize this high-level summary in your review settings.

- Bump version of @pipedream/zendesk to 0.11.0
- Add new actions: Get Article, Get Macro, List Active Macros, and List Articles
- Update existing action versions: Add Ticket Tags (0.0.7), Create Ticket (0.1.11), Delete Ticket (0.1.11), Get Ticket Info (0.0.9), Get User Info (0.0.6), List Locales (0.0.6), List Macros (0.0.6), List Ticket Comments (0.0.6), List Tickets (0.0.9), Remove Ticket Tags (0.0.7), Set Custom Ticket Fields (0.0.4), Set Ticket Tags (0.0.7), Update Ticket (0.2.4), and others.
- Introduce new constants for ACCESS_OPTIONS and INCLUDE_OPTIONS in common/constants.mjs.
- Enhance locale handling in existing actions and sources.
@luancazarine luancazarine linked an issue Nov 26, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Nov 26, 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 Nov 26, 2025 9:56pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 26, 2025 9:56pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

Adds locale-aware Help Center and macro support to the Zendesk component: new actions for Get Article, List Articles, Get Macro, List Active Macros; new locale- and resource-aware propDefinitions and methods in the app; new constants; and many version bumps across actions and sources. (≤50 words)

Changes

Cohort / File(s) Summary
Core app & constants
components/zendesk/zendesk.app.mjs, components/zendesk/common/constants.mjs, components/zendesk/package.json
Adds locale-aware propDefinitions (locale, articleCategoryId, sectionId, articleId, macroId), new public methods (prepareLocalePath, listArticleCategories, listSections, listArticles, getArticle, getMacro, listActiveMacros), simplifies makeRequest usage, introduces ACCESS_OPTIONS and INCLUDE_OPTIONS, and bumps package version 0.10.1→0.11.0.
New Help Center actions
components/zendesk/actions/get-article/get-article.mjs, components/zendesk/actions/list-articles/list-articles.mjs
Adds Get Article and List Articles actions with locale-aware inputs, additionalProps-driven UI logic, validation, pagination via app.paginate, and $summary exports.
New macro actions
components/zendesk/actions/get-macro/get-macro.mjs, components/zendesk/actions/list-active-macros/list-active-macros.mjs
Adds Get Macro and List Active Macros actions; list supports filters (access, categoryId, groupId, include, sort options) and returns macros.
Version bumps — Actions
components/zendesk/actions/...
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-custom-ticket-fields/set-custom-ticket-fields.mjs, .../set-ticket-tags/set-ticket-tags.mjs, .../update-ticket/update-ticket.mjs
Bumped version strings across many action modules (minor increments); one import order swap in set-custom-ticket-fields; no functional changes.
Version bumps — Sources
components/zendesk/sources/...
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
Bumped version strings across multiple source modules; no behavioral changes.

Sequence Diagram(s)

sequenceDiagram
    participant Action as Get Article (action)
    participant App as zendesk.app.mjs
    participant API as Zendesk API

    Action->>App: run({ $, locale, articleId })
    App->>App: prepareLocalePath(locale)
    Note over App: Build locale-prefixed path if locale provided
    App->>API: GET /help_center/{locale}/articles/{articleId}
    API-->>App: article data
    App-->>Action: return article
    Action->>Action: export $summary
Loading
sequenceDiagram
    participant Action as List Articles (action)
    participant App as zendesk.app.mjs
    participant API as Zendesk API

    Note over Action: Validate props (userId vs category/section)
    alt userId provided
        Action->>App: listArticles({ userId, locale: null, ... })
    else no userId
        Action->>App: listArticles({ categoryId?, sectionId?, locale, ... })
    end
    App->>App: paginate(listArticles, params)
    loop pages
        App->>API: GET /help_center/{locale}/articles?... (page)
        API-->>App: articles page
    end
    App-->>Action: return combined articles
    Action->>Action: export $summary with count
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas needing extra attention:
    • components/zendesk/zendesk.app.mjs — locale prefixing, propDefinition option builders and afterCursor handling, new public methods and pagination correctness, and makeRequest integration.
    • components/zendesk/actions/list-articles/list-articles.mjs — additionalProps logic and ConfigurationError conditions.
    • components/zendesk/actions/list-active-macros/list-active-macros.mjs — parameter mapping to API fields and include/sort handling.
    • New constants usage in actions and app.

Possibly related PRs

  • PipedreamHQ/pipedream#18960 — Modifies components/zendesk/zendesk.app.mjs; touches same app file and related propDefinitions.
  • PipedreamHQ/pipedream#17748 — Prior Zendesk component update that expanded app surface and introduced related actions; shares overlapping changes.

Suggested labels

User submitted

Suggested reviewers

  • michelle0927
  • jcortes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only states 'Resolves #19164 and #19165' and lacks meaningful content compared to the repository's template requiring a WHY section. Expand the description to explain the motivation and context. Include details in the WHY section about why these Zendesk Help Center actions are being added.
Title check ❓ Inconclusive The PR title '19164 action zendesk helpcenter' is vague and primarily references an issue number rather than clearly describing the main changes. Revise title to be more descriptive of the actual changes, such as 'Add Zendesk Help Center actions for articles and macros' to better communicate the scope.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements all requirements from issue #19164: adds List Articles action with locale/category/section filtering, Get Article by ID, Get Macro by ID, and List Active Macros actions, supporting the specified Help Center API endpoints.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing Zendesk Help Center and macro-related actions with supporting infrastructure (constants, propDefinitions, methods), with version bumps for existing actions being standard maintenance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 19164-action-zendesk---helpcenter

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3b5aef and 4737d3e.

📒 Files selected for processing (2)
  • components/zendesk/actions/get-article/get-article.mjs (1 hunks)
  • components/zendesk/zendesk.app.mjs (5 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.

Applied to files:

  • components/zendesk/zendesk.app.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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/zendesk.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/zendesk/zendesk.app.mjs
🧬 Code graph analysis (1)
components/zendesk/zendesk.app.mjs (4)
components/zendesk/sources/common/webhook.mjs (1)
  • constants (232-235)
components/asana/asana.app.mjs (1)
  • sections (205-210)
components/zendesk/actions/list-articles/list-articles.mjs (1)
  • articles (94-94)
components/zendesk/actions/list-macros/list-macros.mjs (1)
  • macros (93-93)
🔇 Additional comments (12)
components/zendesk/actions/get-article/get-article.mjs (1)

1-43: LGTM! Well-structured read-only action.

The action is cleanly implemented with appropriate annotations, locale-aware article selection, and proper error handling delegation to the app layer.

components/zendesk/zendesk.app.mjs (11)

1-5: LGTM! Clean import consolidation.

Consolidating the @pipedream/platform imports improves readability without changing functionality.


198-206: LGTM! Locale propDefinition correctly implemented.

The locale options are properly fetched from the Zendesk API and mapped for user selection.


207-236: LGTM! Article category propDefinition correctly implemented.

The category options properly handle pagination and map the category name field for labels.


237-267: LGTM! Section propDefinition correctly implemented.

The section options correctly accept locale and categoryId context and map the section name field.


298-325: LGTM! Macro propDefinition correctly implemented.

The macro options properly handle pagination and correctly map the macro title field for labels.


465-474: LGTM! Clean request method.

The makeRequest method correctly constructs axios calls without the previously flagged unused locale parameter.


661-666: LGTM! Active macros endpoint correctly implemented.

The listActiveMacros method properly calls the /macros/active endpoint.


679-685: LGTM! Locale path helper correctly implemented.

The prepareLocalePath method correctly constructs locale-aware Help Center paths with proper conditional logic.


686-696: LGTM! Article categories endpoint correctly implemented.

The listArticleCategories method properly uses prepareLocalePath to construct locale-aware category paths.


732-742: LGTM! Article retrieval correctly implemented.

The getArticle method properly constructs locale-aware article paths without extraneous parameters.


743-750: LGTM! Macro retrieval correctly implemented.

The getMacro method correctly constructs the macro endpoint path.


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.

@luancazarine luancazarine linked an issue Nov 26, 2025 that may be closed by this pull request
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: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/zendesk/common/constants.mjs (1)

81-81: Critical syntax error: Missing closing braces.

Line 81 has a pre-existing syntax error with an unclosed template literal. The value should be "{{satisfaction.current_comment}}" instead of "{{satisfaction.current_comment".

Apply this diff to fix the syntax error:

   {
     label: "Satisfaction Current Comment",
-    value: "{{satisfaction.current_comment",
+    value: "{{satisfaction.current_comment}}",
   },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10ad254 and a89d43a.

📒 Files selected for processing (29)
  • 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-article/get-article.mjs (1 hunks)
  • components/zendesk/actions/get-macro/get-macro.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-active-macros/list-active-macros.mjs (1 hunks)
  • components/zendesk/actions/list-articles/list-articles.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-custom-ticket-fields/set-custom-ticket-fields.mjs (1 hunks)
  • components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs (1 hunks)
  • components/zendesk/actions/update-ticket/update-ticket.mjs (1 hunks)
  • components/zendesk/common/constants.mjs (2 hunks)
  • components/zendesk/package.json (1 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 (5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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/zendesk.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/zendesk/zendesk.app.mjs
🧬 Code graph analysis (2)
components/zendesk/actions/list-active-macros/list-active-macros.mjs (1)
components/zendesk/zendesk.app.mjs (10)
  • constants (51-61)
  • constants (83-93)
  • constants (115-123)
  • constants (146-154)
  • constants (215-223)
  • constants (245-254)
  • constants (276-284)
  • constants (304-311)
  • constants (415-424)
  • constants (448-452)
components/zendesk/zendesk.app.mjs (4)
components/zendesk/sources/common/webhook.mjs (1)
  • constants (232-235)
components/asana/asana.app.mjs (1)
  • sections (205-210)
components/zendesk/actions/list-articles/list-articles.mjs (1)
  • articles (94-94)
components/zendesk/actions/list-macros/list-macros.mjs (1)
  • macros (93-93)
⏰ 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: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
🔇 Additional comments (44)
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (1)

10-10: Version bump aligns with package updates.

The version increment from 0.1.1 to 0.1.2 is consistent with the broader Zendesk package versioning strategy outlined in the PR. No functional changes detected.

components/zendesk/actions/get-ticket-info/get-ticket-info.mjs (1)

8-8: LGTM! Version bump aligns with package release.

The version increment from 0.0.8 to 0.0.9 is appropriate and aligns with the broader package version update from 0.10.1 to 0.11.0 mentioned in the PR context. No functional changes were made, so there's no risk of introducing issues.

components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs (1)

8-8: LGTM: Version bump aligns with package release.

The version increment from 0.0.6 to 0.0.7 is appropriate for this coordinated release.

components/zendesk/actions/create-ticket/create-ticket.mjs (1)

8-8: LGTM: Version bump aligns with package release.

The version increment is consistent with the coordinated release across Zendesk actions.

components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs (1)

8-8: LGTM: Version bump aligns with package release.

The version increment is consistent with other tag-related actions in this release.

components/zendesk/actions/search-tickets/search-tickets.mjs (1)

8-8: LGTM: Version bump aligns with package release.

The version increment is appropriate for this coordinated release.

components/zendesk/sources/ticket-closed/ticket-closed.mjs (1)

9-9: LGTM: Version bump aligns with package release.

The version increment is consistent with other source components in this release.

components/zendesk/common/constants.mjs (1)

297-298: LGTM: New constants properly exported.

The new ACCESS_OPTIONS and INCLUDE_OPTIONS constants are correctly added to the default export and will support the new macro filtering capabilities.

components/zendesk/package.json (1)

3-3: Version bump is appropriate, but verify new action files are included.

The minor version bump from 0.10.1 to 0.11.0 is semantically correct for adding new features (Help Center actions). However, the AI summary and PR objectives mention new action files (get-article, list-articles, get-macro, list-active-macros) that are not included in this review set.

Please confirm that the following files exist and are part of this PR:

  • components/zendesk/actions/get-article/get-article.mjs
  • components/zendesk/actions/list-articles/list-articles.mjs
  • components/zendesk/actions/get-macro/get-macro.mjs
  • components/zendesk/actions/list-active-macros/list-active-macros.mjs

These files implement the core PR objectives but are not present in the review set.

components/zendesk/sources/new-ticket/new-ticket.mjs (1)

9-9: LGTM: Version bump aligns with package release.

The version increment is consistent with other source components in this release.

components/zendesk/sources/ticket-updated/ticket-updated.mjs (1)

9-9: LGTM! Version bump is appropriate.

The version increment from 0.2.9 to 0.2.10 aligns with the package-wide version update with no functional changes.

components/zendesk/actions/delete-ticket/delete-ticket.mjs (1)

8-8: LGTM! Version bump is appropriate.

The version increment from 0.1.10 to 0.1.11 aligns with the package-wide version update with no functional changes.

components/zendesk/sources/locale-updated/locale-updated.mjs (1)

9-9: LGTM! Version bump is appropriate.

The version increment from 0.0.4 to 0.0.5 aligns with the package-wide version update with no functional changes.

components/zendesk/actions/list-locales/list-locales.mjs (1)

7-7: LGTM! Version bump is appropriate.

The version increment from 0.0.5 to 0.0.6 aligns with the package-wide version update with no functional changes.

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

2-3: LGTM! Import order change has no functional impact.

The reordering of imports is a cosmetic change that doesn't affect behavior.


10-10: LGTM! Version bump is appropriate.

The version increment from 0.0.3 to 0.0.4 aligns with the package-wide version update with no functional changes.

components/zendesk/sources/ticket-added-to-view/ticket-added-to-view.mjs (1)

8-8: LGTM! Version bump is appropriate.

The version increment from 0.0.9 to 0.0.10 aligns with the package-wide version update with no functional changes.

components/zendesk/sources/ticket-solved/ticket-solved.mjs (1)

9-9: LGTM! Version bump is appropriate.

The version increment from 0.2.9 to 0.2.10 aligns with the package-wide version update with no functional changes.

components/zendesk/actions/get-user-info/get-user-info.mjs (1)

7-7: LGTM! Version bump is appropriate.

The version increment from 0.0.5 to 0.0.6 aligns with the package-wide version update with no functional changes.

components/zendesk/sources/ticket-pended/ticket-pended.mjs (1)

9-9: LGTM!

Version bump is consistent with the package version update to 0.11.0.

components/zendesk/actions/list-macros/list-macros.mjs (1)

7-7: LGTM!

Version bump aligns with the package version update.

components/zendesk/actions/list-tickets/list-tickets.mjs (1)

8-8: LGTM!

Version bump is consistent with the package version update.

components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs (1)

7-7: LGTM!

Version bump aligns with the package version update.

components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs (1)

8-8: LGTM!

Version bump is consistent with the package version update.

components/zendesk/actions/update-ticket/update-ticket.mjs (1)

8-8: LGTM!

Version bump aligns with the package version update.

components/zendesk/actions/get-macro/get-macro.mjs (1)

1-32: LGTM!

Clean and well-structured action implementation. The action follows the established patterns used by other Zendesk actions in this codebase:

  • Correct annotations for a read-only operation
  • Proper use of propDefinition for macroId
  • Appropriate summary export
  • Documentation link is accurate
components/zendesk/zendesk.app.mjs (10)

198-206: LGTM!

The locale prop definition correctly fetches and maps available locales.


207-236: LGTM!

The articleCategoryId prop follows the established pagination pattern and correctly passes locale for locale-aware category fetching.


237-267: LGTM!

The sectionId prop correctly cascades locale and categoryId dependencies for filtered section options.


268-297: LGTM!

The articleId prop correctly implements locale-aware article fetching with pagination.


298-325: LGTM!

The macroId prop correctly implements macro fetching with pagination.


663-668: LGTM!

The listActiveMacros method follows the established pattern for list methods.


681-687: LGTM!

The prepareLocalePath helper correctly constructs locale-aware Help Center API paths.


688-698: LGTM!

The listArticleCategories method correctly uses locale-aware path construction.


712-733: LGTM, but note implicit priority.

The method correctly constructs locale-aware article paths. The implicit priority (userId > sectionId > categoryId) is handled, though the action layer enforces mutual exclusivity for userId which prevents unexpected behavior.


746-753: LGTM!

The getMacro method correctly implements the macro retrieval endpoint.

components/zendesk/actions/list-articles/list-articles.mjs (4)

1-14: LGTM!

Action metadata and imports are properly configured with appropriate read-only annotations.


15-62: LGTM!

Props are correctly configured with proper dependencies and reloadProps trigger for dynamic visibility.


63-73: LGTM!

The additionalProps method correctly manages prop visibility based on userId selection, improving UX by hiding irrelevant filters.


74-104: LGTM!

The run method correctly validates incompatible parameters, handles locale appropriately for userId queries, and properly paginates results with a well-formatted summary.

components/zendesk/actions/list-active-macros/list-active-macros.mjs (2)

1-14: LGTM!

Action metadata and imports are properly configured.


15-58: LGTM!

Props are correctly configured using constants and prop definitions from the app.

components/zendesk/actions/get-article/get-article.mjs (2)

14-32: LGTM!

Props are correctly configured with locale dependency for article ID options.


33-42: LGTM!

The run method correctly retrieves and returns the article with an appropriate summary.

- Simplified URL construction in makeRequest by removing unnecessary locale handling.
- Corrected typo in the description of the Get Article action.
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: 2

♻️ Duplicate comments (2)
components/zendesk/zendesk.app.mjs (2)

465-476: Unused locale parameter causes confusion and potential URL bugs.

The locale parameter added to makeRequest is not used by any Help Center methods (they use prepareLocalePath instead). Additionally, the URL construction ${locale ? locale : ""}${path} would produce malformed URLs if used (e.g., "en-us/tickets/123" missing the leading /).

Remove the unused locale parameter:

     makeRequest({
-      step = this, url, path, locale = "", headers, customSubdomain, ...args
+      step = this, url, path, headers, customSubdomain, ...args
     }) {
       return axios(step, {
         headers: this.getHeaders(headers),
-        url: url ?? this.getUrl(`${locale
-          ? locale
-          : ""}${path}`, customSubdomain),
+        url: url ?? this.getUrl(path, customSubdomain),
         timeout: constants.DEFAULT_TIMEOUT,
         ...args,
       });
     },

699-711: Bug: Double slashes in path construction.

The path template produces malformed URLs with double slashes:

  • When categoryId is provided: //categories/{id}/sections
  • When categoryId is null: //sections

Apply this diff to fix:

     listSections({
       locale, categoryId, ...args
     } = {}) {
       return this.makeRequest({
         path: this.prepareLocalePath({
           locale,
-          path: `/${categoryId
-            ? `/categories/${categoryId}`
-            : ""}/sections`,
+          path: categoryId
+            ? `/categories/${categoryId}/sections`
+            : "/sections",
         }),
         ...args,
       });
     },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a89d43a and f3b5aef.

📒 Files selected for processing (1)
  • components/zendesk/zendesk.app.mjs (5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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/zendesk.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/zendesk/zendesk.app.mjs
🧬 Code graph analysis (1)
components/zendesk/zendesk.app.mjs (4)
components/zendesk/sources/common/webhook.mjs (1)
  • constants (232-235)
components/asana/asana.app.mjs (1)
  • sections (205-210)
components/zendesk/actions/list-articles/list-articles.mjs (1)
  • articles (94-94)
components/zendesk/actions/list-macros/list-macros.mjs (1)
  • macros (93-93)
⏰ 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: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (4)
components/zendesk/zendesk.app.mjs (4)

1-5: LGTM!

Import consolidation is clean and follows the existing patterns in the codebase.


663-668: LGTM!

The listActiveMacros method follows the established pattern and correctly targets the /macros/active endpoint.


681-697: LGTM!

The prepareLocalePath helper and listArticleCategories method are well-implemented with proper locale handling.


734-752: LGTM!

The getArticle and getMacro methods are correctly implemented. The previously flagged helpCenter: true parameter has been removed.

Comment on lines +289 to +294
options: articles.map(({
id: value, name: label,
}) => ({
value,
label,
})),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

Script executed:

#!/bin/bash
# Search for article-related code in the zendesk app
rg -n "article" components/zendesk/zendesk.app.mjs -i -C 5

Repository: PipedreamHQ/pipedream


<shell_result>
Repository: PipedreamHQ/pipedream
Exit code: 0

stdout:

181-      label: "Fields",
182-      description: "Ticket fields to be included in the incoming webhook payload",
183-      withLabel: true,
184-      optional: true,
185-      async options() {
186:        // placehoders reference - https://support.zendesk.com/hc/en-us/articles/4408886858138
187-        const { ticket_fields: customFields } = await this.listTicketFields();
188-        const fields = customFields.reverse().map(({
189-          id, title,
190-        }) => ({
191-          label: title,
--
196-      },
197-    },
198-    locale: {
199-      type: "string",
200-      label: "Locale",
201:      description: "The locale of the article",
202-      async options() {
203-        const { locales } = await this.listLocales();
204-        return locales.map((locale) => locale.locale);
205-      },
206-    },
207:    articleCategoryId: {
208-      type: "string",
209:      label: "Article Category ID",
210:      description: "The ID of the article category",
211-      async options({
212-        locale, prevContext,
213-      }) {
214-        const { afterCursor } = prevContext;
215-        const {
216-          categories, meta,
217:        } = await this.listArticleCategories({
218-          locale,
219-          params: {
220-            [constants.PAGE_SIZE_PARAM]: constants.DEFAULT_LIMIT,
221-            [constants.PAGE_AFTER_PARAM]: afterCursor,
222-          },
--
263-            label,
264-          })),
265-        };
266-      },
267-    },
268:    articleId: {
269-      type: "string",
270:      label: "Article ID",
271:      description: "The ID of the article. You can use the List Articles action to get the ID of the article.",
272-      async options({
273-        locale, prevContext,
274-      }) {
275-        const { afterCursor } = prevContext;
276-        const {
277:          articles, meta,
278:        } = await this.listArticles({
279-          locale,
280-          params: {
281-            [constants.PAGE_SIZE_PARAM]: constants.DEFAULT_LIMIT,
282-            [constants.PAGE_AFTER_PARAM]: afterCursor,
283-          },
284-        });
285-        return {
286-          context: {
287-            afterCursor: meta.after_cursor,
288-          },
289:          options: articles.map(({
290-            id: value, name: label,
291-          }) => ({
292-            value,
293-            label,
294-          })),
--
681-    }) {
682-      return `/help_center${locale
683-        ? `/${locale}`
684-        : ""}${path}`;
685-    },
686:    listArticleCategories({
687-      locale, ...args
688-    } = {}) {
689-      return this.makeRequest({
690-        path: this.prepareLocalePath({
691-          locale,
--
705-            : ""}/sections`,
706-        }),
707-        ...args,
708-      });
709-    },
710:    listArticles({
711-      locale, categoryId, sectionId, userId, ...args
712-    } = {}) {
713-      let path = "";
714-      if (categoryId) {
715-        path = `/categories/${categoryId}`;
--
722-      }
723-
724-      return this.makeRequest({
725-        path: this.prepareLocalePath({
726-          locale,
727:          path: `${path}/articles`,
728-        }),
729-        ...args,
730-      });
731-    },
732:    getArticle({
733:      articleId, locale, ...args
734-    } = {}) {
735-      return this.makeRequest({
736-        path: this.prepareLocalePath({
737-          locale,
738:          path: `/articles/${articleId}`,
739-        }),
740-        ...args,
741-      });
742-    },
743-    getMacro({

</shell_result>


Zendesk Help Center API article response structure fields


<web_search_result>
Common fields returned in a Help Center Article JSON (Show Article / List Articles endpoints) include — for each article object:

  • id. [1]
  • title. [1]
  • body (article HTML). [1][2]
  • author_id. [1]
  • locale / source_locale. [1][2]
  • created_at, updated_at, edited_at. [1]
  • draft (boolean). [1]
  • promoted (boolean). [1]
  • position. [1]
  • comments_disabled (boolean). [1]
  • permission_group_id. [1]
  • user_segment_id. [1]
  • content_tag_ids (or label_names / tags). [1]
  • section_id / category_id (when sideloaded or in list contexts). [1]
  • attachments / guide_medias (sideloaded objects or attachment metadata). [1][3]
  • translations (embedded when requested). [2]

For full, authoritative field lists, examples, and endpoint details see the Zendesk Help Center API docs. [1][2][3]

Sources: Zendesk Developer Docs — Articles, Help Center Search, Guide Medias. [1] https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/ [2] https://developer.zendesk.com/api-reference/help_center/help-center-api/help_center_search/ [3] https://developer.zendesk.com/api-reference/help_center/help-center-api/guide_medias/
</web_search_result>


Article property should be title, not name—dropdown labels will be undefined with current code.

The Zendesk Help Center API documentation confirms that articles have a title field, not name. The current mapping will result in undefined labels in the dropdown.

Apply this fix:

         options: articles.map(({
-          id: value, name: label,
+          id: value, title: label,
         }) => ({
           value,
           label,
         })),
📝 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.

Suggested change
options: articles.map(({
id: value, name: label,
}) => ({
value,
label,
})),
options: articles.map(({
id: value, title: label,
}) => ({
value,
label,
})),
🤖 Prompt for AI Agents
In components/zendesk/zendesk.app.mjs around lines 289 to 294, the mapping
destructures article objects using `name` for the label which is incorrect per
the Zendesk Help Center API; change the destructuring to use `title` (e.g.,
articles.map(({ id: value, title: label }) => ({ value, label }))) so dropdown
labels are populated from the article title.

Comment on lines +712 to +733
listArticles({
locale, categoryId, sectionId, userId, ...args
} = {}) {
let path = "";
if (categoryId) {
path = `/categories/${categoryId}`;
}
if (sectionId) {
path = `/sections/${sectionId}`;
}
if (userId) {
path = `/users/${userId}`;
}

return this.makeRequest({
path: this.prepareLocalePath({
locale,
path: `${path}/articles`,
}),
...args,
});
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Filter priority may cause unexpected behavior.

When multiple filters (categoryId, sectionId, userId) are provided, later ones silently overwrite earlier ones. For example, if both categoryId and sectionId are passed, sectionId takes precedence with no warning.

Consider either:

  1. Document the precedence behavior, or
  2. Throw an error if conflicting filters are provided:
     listArticles({
       locale, categoryId, sectionId, userId, ...args
     } = {}) {
+      const filters = [categoryId, sectionId, userId].filter(Boolean);
+      if (filters.length > 1) {
+        throw new Error("Only one of categoryId, sectionId, or userId can be specified");
+      }
       let path = "";
       if (categoryId) {
         path = `/categories/${categoryId}`;
       }
-      if (sectionId) {
+      else if (sectionId) {
         path = `/sections/${sectionId}`;
       }
-      if (userId) {
+      else if (userId) {
         path = `/users/${userId}`;
       }
📝 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.

Suggested change
listArticles({
locale, categoryId, sectionId, userId, ...args
} = {}) {
let path = "";
if (categoryId) {
path = `/categories/${categoryId}`;
}
if (sectionId) {
path = `/sections/${sectionId}`;
}
if (userId) {
path = `/users/${userId}`;
}
return this.makeRequest({
path: this.prepareLocalePath({
locale,
path: `${path}/articles`,
}),
...args,
});
},
listArticles({
locale, categoryId, sectionId, userId, ...args
} = {}) {
const filters = [categoryId, sectionId, userId].filter(Boolean);
if (filters.length > 1) {
throw new Error("Only one of categoryId, sectionId, or userId can be specified");
}
let path = "";
if (categoryId) {
path = `/categories/${categoryId}`;
}
else if (sectionId) {
path = `/sections/${sectionId}`;
}
else if (userId) {
path = `/users/${userId}`;
}
return this.makeRequest({
path: this.prepareLocalePath({
locale,
path: `${path}/articles`,
}),
...args,
});
},
🤖 Prompt for AI Agents
In components/zendesk/zendesk.app.mjs around lines 712–733, the code silently
overwrites path when multiple filters (categoryId, sectionId, userId) are
provided; either enforce a single-filter rule or make precedence explicit. Fix
by validating inputs at the top of listArticles: count how many of categoryId,
sectionId, userId are non-null and if more than one is present throw a
descriptive error (e.g., "Provide exactly one of categoryId, sectionId, or
userId") so callers fail fast; alternatively, if you prefer a precedence rule,
replace the three independent ifs with an explicit if/else-if chain (and
document the chosen precedence in the method JSDoc) so only the highest-priority
filter is applied.

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @luancazarine lgtm! Ready for QA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ACTION] Zendesk - Macros [ACTION] Zendesk - Helpcenter

3 participants