Aug 16 2010
GLPI Ticket User Group Auto Assignment
GLPI user has to select the group he belongs to when creating a ticket or else the field remains empty.
This stored procedure automatically assigns all tickets to the user’s group. Setup a cron job to run it every so often.
begin update SI_BD.glpi_tracking t set t.fk_group= ( SELECT g.id FROM SI_BD.glpi_users u, SI_BD.glpi_groups g, SI_BD.glpi_users_groups ug WHERE u.id = ug.fk_users AND g.id = ug.fk_groups AND u.id=t.author LIMIT 0 , 1) where t.fk_group is null or t.fk_group='' or t.FK_group=0; end

