Hello,

I'm trying to retrieve all "required to close" tickets fields in the database.

I guessed that the flags column in ost_form_field is used to do it, but I don't understand how to interpret it ...

May I have some help ?

Thanks 🙂

It is the Flags column.

Required is a flag:
https://github.com/osTicket/osTicket/blob/develop/include/class.dynamic_forms.php#L610
https://github.com/osTicket/osTicket/blob/develop/include/class.dynamic_forms.php#L862-L864

include/class.dynamic_forms.php:610
const FLAG_CLOSE_REQUIRED = 0x00004;

You can use PHP to check it
https://www.php.net/manual/en/language.operators.bitwise.php

I have a field called "Time Spent" which i know is required to close a ticket. The flags field is 12,293.
<?php
if ((12293 & 0x00004) != 0)
echo 'true';
else
echo 'false'; ?>


I am not aware of a way to do this in SQL though. Maybe someone more versed in SQL than I would be able to tell you if a similar operator exists for MySQL.

Write a Reply...