Skip to content

Fix SLA breach on tickets with no real external customer (v1.9.0-a2) - #277

Closed
fivetran-catfritz wants to merge 2 commits into
bug/RD-1277353-private-comment-first-reply-slafrom
bug/RD-1277353-internal-only-ticket-sla
Closed

fivetran-catfritz wants to merge 2 commits into
bug/RD-1277353-private-comment-first-reply-slafrom
bug/RD-1277353-internal-only-ticket-sla

Conversation

@fivetran-catfritz

@fivetran-catfritz fivetran-catfritz commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #273's a1 pre-release. The a1 fix correctly delays the first_reply_time SLA clock for tickets created on a customer's behalf via a private comment, until the customer engages (public or private). But it keys "customer hasn't engaged yet" off first_external_comment_at is null, which is also permanently true for tickets that have no real external customer at all (e.g. an agent filing a ticket on their own behalf for an internal process). Those tickets waited indefinitely for a customer who was never coming, producing false breaches in production immediately after the a1 upgrade.

Confirmed against production data: on an affected ticket, every commenter was an agent/admin, and Zendesk's own first_reply_time field history showed a single entry logged at ticket creation with no later re-application — unlike genuine privately-created tickets, Zendesk isn't waiting on anyone here either.

Fix

  • int_zendesk__commenter_reply_at.sql / int_zendesk__sla_policy_applied.sql: only disqualify/shift when a real, later external comment actually exists (drop the OR first_external_comment_at IS NULL branch), wrapped in coalesce(..., false) since SQL's NULL propagation through AND/NOT was silently re-disqualifying anyway.
  • Added seed ticket 20002 (agent is its own requester, no external commenter ever) to cover this case; ticket 20001 (genuine privately-created ticket) is unchanged, confirming no regression.
  • CHANGELOG/DECISIONLOG updated, marked as v1.9.0-a2.

Test plan

  • dbt build passes locally (DuckDB) including sla_first_reply_time_match
  • Ticket 20002 (no real customer): is_sla_breach flips from true to false, anchored correctly at ticket_created_at
  • Ticket 20001 (genuine privately-created, real customer): unchanged, still correctly shifts anchor and disqualifies the early reply
  • CI across all warehouses

🤖 Generated with Claude Code

fivetran-catfritz and others added 2 commits September 30, 2026 09:52
…-1277353)

The a1 fix disqualified an agent's early public reply on privately-created
tickets until the customer engaged, keyed off first_external_comment_at
being null. But that column is a lifetime MIN() -- when a ticket has no
real external commenter at all (e.g. an agent filing a ticket on their own
behalf), it's permanently null, so the disqualification never lifts and
the ticket waits indefinitely for a customer who will never show up.

Confirmed against production data (ticket 418211 and others): every
commenter was an agent or admin, and Zendesk's own first_reply_time
field history shows a single entry logged at ticket creation with no
later re-application -- unlike genuine privately-created tickets, Zendesk
isn't waiting on anyone here either.

Fix: only disqualify when a real, later external comment actually exists
(drop the "OR first_external_comment_at IS NULL" branch), and coalesce
the boolean check to false so SQL's NULL-propagation through AND doesn't
silently re-disqualify anyway. Added seed ticket 20002 (agent is its own
requester, no external commenter ever) to cover this.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…7353)

Pre-releases each get their own dated entry; the a1 section's original
content stays untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fivetran-catfritz fivetran-catfritz added the pre-release Triggers the auto-releaser workflow. label Sep 30, 2026

@fivetran-jamie fivetran-jamie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved for pre-release

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

Labels

pre-release Triggers the auto-releaser workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants