Repository navigation
Fix SLA breach on tickets with no real external customer (v1.9.0-a2) - #277
Closed
fivetran-catfritz wants to merge 2 commits into
Closed
fivetran-catfritz wants to merge 2 commits into
fivetran-catfritz wants to merge 2 commits into
Conversation
…-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-jamie
approved these changes
Sep 30, 2026
fivetran-jamie
left a comment
Contributor
There was a problem hiding this comment.
Approved for pre-release
fivetran-catfritz
force-pushed
the
bug/RD-1277353-internal-only-ticket-sla
branch
from
October 1, 2026 15:36
c1fb7b3 to
d632feb
Compare
5 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #273's a1 pre-release. The a1 fix correctly delays the
first_reply_timeSLA 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" offfirst_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_timefield 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 theOR first_external_comment_at IS NULLbranch), wrapped incoalesce(..., false)since SQL'sNULLpropagation throughAND/NOTwas silently re-disqualifying anyway.v1.9.0-a2.Test plan
dbt buildpasses locally (DuckDB) includingsla_first_reply_time_matchis_sla_breachflips fromtruetofalse, anchored correctly atticket_created_at🤖 Generated with Claude Code