Skip to content

enhancement:- Added Queue Support for Zendesk#1321

Merged
prakharritik merged 1 commit into
mainfrom
backend/zendesk/queue
Jun 2, 2026
Merged

enhancement:- Added Queue Support for Zendesk#1321
prakharritik merged 1 commit into
mainfrom
backend/zendesk/queue

Conversation

@Kuldeepkumawat144
Copy link
Copy Markdown
Contributor

@Kuldeepkumawat144 Kuldeepkumawat144 commented Jun 2, 2026

Type of Change

  • Bugfix
  • New feature
  • [X ] Enhancement
  • Refactoring
  • Dependency updates

Description

Additional Changes

  • This PR modifies the database schema (database migration added)
  • This PR modifies dhall configs/environment variables

Motivation and Context

How did you test it?

Checklist

  • I formatted the code and addressed linter errors ./dev/format-all-files.sh
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

Summary by CodeRabbit

New Features

  • Added support for categorizing tickets as issue reports, SOS alerts, or feedback items to improve organization and tracking.
  • Implemented intelligent ticket routing that directs different ticket types to appropriate support channels for more efficient handling and prioritization.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Warning

Review limit reached

@Kuldeepkumawat144, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 35 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73073877-06d5-4e8a-affb-30a0940ee825

📥 Commits

Reviewing files that changed from the base of the PR and between ea0d396 and 1521cbc.

📒 Files selected for processing (3)
  • lib/mobility-core/src/Kernel/External/Ticket/Interface/Types.hs
  • lib/mobility-core/src/Kernel/External/Ticket/Interface/Zendesk.hs
  • lib/mobility-core/src/Kernel/External/Ticket/Zendesk/Config.hs

Walkthrough

This PR extends Zendesk ticket integration to route ticket creation requests to context-specific group IDs. It introduces a TicketContext type to categorize tickets, updates the request schema, expands configuration to support multiple group IDs, and implements routing logic to select the appropriate group based on ticket type.

Changes

Context-Aware Zendesk Ticket Routing

Layer / File(s) Summary
Ticket Context and Request Schema
lib/mobility-core/src/Kernel/External/Ticket/Interface/Types.hs
TicketContext algebraic type with three variants (IssueTicket, SOSAlert, FeedbackTicket) is introduced with JSON/schema derivation. CreateTicketReq record is extended with a ticketContext field alongside the existing becknIssueId field.
Zendesk Configuration Extension
lib/mobility-core/src/Kernel/External/Ticket/Zendesk/Config.hs
ZendeskCfg record is extended with two optional fields: sosGroupId and feedbackGroupId, enabling separate group routing per ticket type.
Context-Aware Group ID Resolution
lib/mobility-core/src/Kernel/External/Ticket/Interface/Zendesk.hs
resolveGroupId helper maps TicketContext variants to configuration fields (SOS alert → sosGroupId, feedback ticket → feedbackGroupId, issue ticket → groupId). mkZendeskCreateTicketReq is updated to apply context-aware routing when setting the ticket group ID.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • nammayatri/shared-kernel#1312: Modifies mkZendeskCreateTicketReq to include htmlBody in ticket comment payloads alongside body, overlapping with the group ID routing changes in this PR.
  • nammayatri/shared-kernel#1297: Extends both Kernel.External.Ticket.Interface.Zendesk and ZendeskCfg configuration, with similar structural changes to support context-dependent ticket handling.

Suggested reviewers

  • khuzema786
  • Vignesh-772
  • prakharritik

Poem

🐰 Three ticket types hop into the fold,
Context guides them where to go—
SOS, feedback, issues bold,
Different groups now help them flow!
Routes resolve with care and grace,
Each ticket finds its proper place.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title claims 'Queue Support for Zendesk' but the changeset actually adds ticket context categorization (issue/SOS/feedback) with group ID routing, not queue support. Revise the title to accurately reflect the changes, such as 'Add ticket context routing for Zendesk group IDs' or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backend/zendesk/queue

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.

Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/mobility-core/src/Kernel/External/Ticket/Interface/Types.hs`:
- Around line 71-72: CreateTicketReq currently declares ticketContext ::
TicketContext (non-optional) and derives FromJSON, causing decoding failures for
payloads that omit ticketContext; update the JSON decoding to be
backward-compatible by either (A) changing the field to ticketContext :: Maybe
TicketContext and adjust downstream usages to handle Nothing, or (B) implement a
custom FromJSON instance for CreateTicketReq that treats a missing
"ticketContext" as a sensible default (e.g., IssueTicket) when parsing; modify
the FromJSON for CreateTicketReq (referencing CreateTicketReq, ticketContext,
TicketContext, and IssueTicket) so existing producers' payloads without the
field still decode correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb1de9e9-113a-47fa-a85f-b8a8d7b823b7

📥 Commits

Reviewing files that changed from the base of the PR and between 1e3abfa and ea0d396.

📒 Files selected for processing (3)
  • lib/mobility-core/src/Kernel/External/Ticket/Interface/Types.hs
  • lib/mobility-core/src/Kernel/External/Ticket/Interface/Zendesk.hs
  • lib/mobility-core/src/Kernel/External/Ticket/Zendesk/Config.hs

Comment thread lib/mobility-core/src/Kernel/External/Ticket/Interface/Types.hs Outdated
@prakharritik prakharritik merged commit 1aa00c4 into main Jun 2, 2026
2 checks passed
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.

2 participants