Ir al contenido principal

Querying Custom Fields - Base de conocimiento / Using Deskpro / Reports - Deskpro Support

Querying Custom Fields

Lista de autores

One of the strengths of Deskpro is the flexibility creating custom ticket fields provides.

However, as the fields are custom, any you create will not be referenced in the Reporting Documentation.

The way we work around this is by using:

tickets.custom_data[#] 

You need to add the field ID to the field to be referenced like other fields in the tickets table, such as tickets.id, or tickets.status.


Locating the field ID

Note


To view the information to reference your custom ticket fields, you need access to the Admin interface, or you can ask an Admin user for the custom field IDs.

To locate the ticket ID, you need to go into the following area in the Admin Interface:

Admin > Ticket Structure > Ticket Fields. The Field IDs display by default in the furthest right column on the table:


In this example, the field reference for the custom field 'Enquiry type' is 11

Example

Based on this, if I wanted to run a query showing ticket IDs and the Enquiry type entered in the custom field for those tickets, I can run the below:

SELECT  tickets.id, tickets.custom_data[11]

FROM tickets

Útil Poco útil