have you tested to see if it updates once you press the close button?
To my understanding, as long as the ticket isn’t closed or in a state of submitted, or in any state that is writing to database, then it isn’t writing anything to the db as yet. Once the close button is pressed, or the ticket is settled, then it begins writing the information into the db and saving it.
So I’d check if it will show once you press the close button, then re run that script of yours and see the results.
Or maybe I’m misunderstanding