1

Zendesk – customer ticket creation

Question

Who created a ticket? Who did not create a ticket?

These sub queries are best applied to other tables if you want to join in from your user database or from the `identifies` table. The primary key with the `identifies` table is the `external_id` column on the `zendesk.users` table.

For more examples of how you can analyze Zendesk and customer event data together, check out our blog post on measuring the ROI of support

Sources

Zendesk (full schema here)

How

The column `created_at` on the table `zendesk.tickets` is what determines whether or not a ticket has been created. If that column exists for a user, then the user has created a ticket. Otherwise, the user did not create a ticket.

Query to see who created a ticket

select *,
  case when t.created_at is not null then 'Ticket created' end as ticket
  from zendesk.organizations o
  join zendesk.users u
  on o.id = u.organization_id
  left join zendesk.tickets t
  on t.requester_id = u.id

Query to see who did not create a ticket

select *,

  case when t.created_at is null then 'Ticket not created' end as ticket
  from zendesk.organizations o
  join zendesk.users u
  on o.id = u.organization_id
  left join zendesk.tickets t
  on u.id = t.requester_id