Export a list of created tickets within a specific group including email adresses

Infos:

  • Used Zammad version: 5.3.1-1675259950.8ebe3877.bullseye
  • Used Zammad installation type: (source, package, docker-compose, …) package
  • Operating system: Debian
  • Browser + version: Google Chrome 110.0.5481.105 (Official Build) (64-bit)

Expected behavior:

I need to export a list of all the customers that created a ticket within a specific group. I tried to do this via a Report Profile, but that does not include email addresses.

Can someone help me to create a script that could do this?

Thx

You could try it by query’ing the database in SQL. Maybe something like this (tested on PostgreSQL):

SELECT DISTINCT
        users.firstname AS "Firstname",
        users.lastname AS "Surname",
        users.email AS "E-Mail"
FROM
        tickets
FULL JOIN users ON users.id = tickets.customer_id
LEFT JOIN groups ON tickets.group_id = groups.id

WHERE
        groups.name = 'Users'
ORDER BY 2 ;

Thanks, worked!

Here the complete command I ran

\copy (SELECT DISTINCT
        users.firstname AS "Firstname",
        users.lastname AS "Surname",
        users.email AS "E-Mail"
FROM
        tickets
FULL JOIN users ON users.id = tickets.customer_id
LEFT JOIN groups ON tickets.group_id = groups.id

WHERE
        groups.name = 'XXX'
ORDER BY 2 ) TO '/tmp/test.csv' WITH CSV DELIMITER ',' HEADER

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.