Neidio i'r brif gynnwys

What do I use in a query to retrieve the email address of ticket users? - Knowledgebase / Deskpro Legacy - Deskpro Support

WARNING: You're browsing documentation for an older version of Deskpro. For the most up-to-date version, see: Retrieve Ticket Owner Email Addresses

What do I use in a query to retrieve the email address of ticket users?

Rhestr o awduron

Question: 

I want to make a query that returns a table of tickets, including the email address of each ticket's owner. What do I use in my query to retrieve that?

Answer:

You can cross-reference from the tickets table to the person table using: 

tickets.person.primary_email.email

 

e.g.:

SELECT tickets.id, tickets.subject, tickets.date_created, tickets.person.primary_email.emailFROM ticketsWHERE tickets.date_created >= '2014-01-08'LIMIT 5000

 

which would give you a table like this: 

IDSubjectDate CreatedEmail
 526 Problem with tiger     Wed, 8th Jan 2014 12:21 am   user@example.com    
Defnyddiol Annefnyddiol

Roedd 71 o 126 o bobl yn teimlo bod y dudalen hon yn ddefnyddiol

Ychwanegu sylw

Mewngofnodwch neu cofrestrwch i gyflwyno sylw.

Angen atgofiad am eich cyfrinair?