Skip to content

feat: Add Intercom Tickets stream support with incremental replication#87

Open
mporracindie wants to merge 7 commits intosinger-io:masterfrom
blueprint-data:master
Open

feat: Add Intercom Tickets stream support with incremental replication#87
mporracindie wants to merge 7 commits intosinger-io:masterfrom
blueprint-data:master

Conversation

@mporracindie
Copy link
Copy Markdown

Description of change

This PR adds support for the Intercom Tickets API to tap-intercom, enabling extraction of ticket data using incremental replication with the Search API.

Key Changes:

  • Added new tickets stream using POST /tickets/search endpoint
  • Implemented incremental replication with updated_at bookmark
  • Supports cursor-based pagination with starting_after parameter
  • Extracts all ticket fields including custom attributes, contacts, ticket parts, and linked objects
  • Follows existing pattern from Contacts and Conversations streams

Files Modified:

  • tap_intercom/schemas/tickets.json (NEW) - JSON schema with 20+ ticket fields
  • tap_intercom/streams.py - Added Tickets class (55 lines) and registered in STREAMS dict
  • README.md - Updated documentation with tickets stream details
  • CHANGELOG.md - Added version 2.3.0 entry

Technical Details:

  • Replication method: INCREMENTAL (query filtered)
  • Primary key: id
  • Replication key: updated_at
  • Foreign keys: contact_ids, admin_assignee_id, team_assignee_id
  • Pagination: 150 records per page with intermediate bookmarks
  • Custom attributes supported via additionalProperties: true

Manual QA steps

  • Run discovery mode and verify tickets stream appears in catalog
    tap-intercom --config config.json --discover | grep "tickets"                                                                                              
  • Run full sync and verify tickets are extracted
    tap-intercom --config config.json --catalog catalog.json
  • Verify incremental sync respects bookmark (run twice with state file)
  • Verify interrupted sync resumes correctly using intermediate bookmarks
  • Verify all ticket fields are extracted (id, title, description, contacts, ticket_parts, etc.)
  • Verify timestamps are converted to ISO 8601 format
  • Verify custom ticket_attributes are extracted
  • Verify pagination works correctly

Test Results:

  • Successfully extracted 450+ tickets from test workspace
  • All fields properly formatted and timestamps converted
  • Pagination working with cursor-based navigation
  • Bookmarks written correctly after each page

Risks

  • Low Risk: This is a new stream addition with no changes to existing functionality
  • No modifications to existing streams, client, or transform logic
  • Follows well-established patterns from Contacts and Conversations streams
  • No breaking changes to existing API contracts or schemas
  • Mitigation: Tickets stream is opt-in via catalog selection; existing streams unaffected

Rollback steps

  • Revert this branch
  • Alternative: Remove tickets from catalog selection in production until issues are resolved
  • No database migrations or state changes required for rollback

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • [ x ] this PR has been written with the help of GitHub Copilot or another generative AI tool

…s classes

- Added get_start_bookmark method to IncrementalStream for improved bookmark retrieval.
- Updated Conversations class to utilize the new get_start_bookmark method.
- Implemented tests for resuming from in-progress bookmarks and verifying state updates.
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.

1 participant