hmm, I've wrtitten a stat script too, and I haven't noticed this strange
behaviour.
If you view the ticket as closed in the web interface, then it should be
closed in the database too, maybe it's just an error in your script.
To be sure of that, look at TICKET_STATE_ID in table TICKET.
Hope
I'm using 2.2.3 I've added the priority to the database but the ticket and
other places still only show the first 5 priorities. I've changed the names
of most of them and they show up fine except for this new 6th priority.
I've done everything in the manual about changing priorities but there