Skip to main content

It can sometimes be useful to have a custom field on a ticket to record a number.

If perhaps it is a ticket requesting equipment, you may want to record the number of items that have been issued.

When it comes to reporting on this number you can add entries from multiple tickets together to form a total using the MYSQL SUM function.

A simple example would be the below where #1 is the ticket field id

SELECT SUM(tickets.custom_data[1]) AS 'Total'
FROM tickets

Note with this function it does not require the DPQL prefix.

Authors list

First published: 27/06/2019

Last updated: Jul 26, 2019 by Matthew Wray