Using SQL statements to query information from OTRS database

Source:www.opentechguides.com | Date Published: 2019-02-15 14:42:21

OTRS provides a GUI interface for administrators called SQL Box to run SQL statements on its database. The results of the queries can be displayed on the screen or exported to HTML, CSV or Excel file formats. To access SQL Box, you must be logged in as a user who is in the admin group.

Once logged in, click on the Admin tab and you will find SQL Box under the Administration section.

OTRS SQL Box
SQL Box

Click SQL Box, then enter SQL statement in the SQL box, select the result format and click Run Query.

You can also limit the number of rows in the result using the Limit field or leave it empty for no limit.

OTRS SQL Box
Executing SQL statements

SQL Examples

Here are a a few SQL statements to query information about tickets, queues, agents and customers from OTRS database. It is worth noting that the OTRS database schema can be different for different versions of OTRS. The SQL statements below have been tested on OTRS version 6 only and are not guaranteed to run on other versions of OTRS.

For more queries, leave us a comment below.


Open Tech Guides | www.opentechguides.com