feat(conversations): import zendesk ticket tags - #69972
Merged
Merged
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "feat(conversations): import zendesk tick..." | Re-trigger Greptile |
Zendesk's ticket payload already carries the tags array, but the import discarded it. Newly imported tickets now get their Zendesk tags as team-scoped Tag rows (normalized and deduplicated like the live tagging API) linked via TaggedItem, so imported tickets work with tag filters and display immediately. Generated-By: PostHog Code Task-Id: ae286dd4-cda9-4d8b-8a14-7efd4621c0bc
abigailbramble
force-pushed
the
posthog-code/zendesk-import-ticket-tags
branch
from
July 10, 2026 14:31
1ad9ede to
1c670ba
Compare
|
The open thread about long tag-name collisions does not describe a security vulnerability in this code path. Truncating normalized Zendesk tags to fit the Tag.name column can merge distinct labels and affect categorization/filtering, but it does not create a plausible confidentiality, integrity, auth, or availability exploit beyond ordinary data correctness. I’m not filing a security finding for it. |
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.
Problem
Zendesk tickets carry tags, and teams rely on them to categorize and filter their support queue. The historical Zendesk import fetches the full ticket payload (which includes the
tagsarray) but silently discards it, so imported tickets arrive untagged and teams lose that categorization.Changes
Newly imported tickets now get their Zendesk tags, wired into PostHog's product-wide tag system (
Tag/TaggedItem) rather than stored as loose strings:tagsarray from the Zendesk payload is normalized the same way the live tagging API does (tagify: lowercase + strip, empties dropped, deduped per ticket). No extra Zendesk API calls - the tags are already in theshow_manyresponse the import fetches.Tagrows viaget_or_create, matching the live apply path (set_tags_on_object): existing tags are reused, new ones created, never duplicated per team.TaggedItemlinks are bulk-created inside the import transaction after tickets get their IDs.Because tags land in the shared tag system, imported tickets immediately work with everything tags already support: the ticket list's
tags/tags_all/tags_excludefilters, tag display, and cross-product tag queries.Note
The
TaggedItemlinks usebulk_create, which skipssave()/full_clean()and signals on purpose - the same no-signals rule as every other historical write in this import. Tags are applied only to tickets the import creates; already-imported (skipped) tickets are deliberately untouched.How did you test this code?
"Billing"," URGENT "→billing,urgent), empty tags dropped, a pre-existing team tag reused instead of duplicated, oneTagrow shared across tickets in a batch, and untagged tickets staying untagged. No existing test exercised tags in the import, so this catches regressions in the mapping, normalization, or per-team dedupe.zendesk_import/tests/test_activities.pysuite locally: 25 passed.Automatic notifications
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
/writing-tests.Tagrows are resolved withget_or_createbefore the ticket transaction to keep the lock window narrow; aTagrow left behind by a failed batch is harmless and reused on retry.Created with PostHog Code