What I initially thought you were trying to do was calculate duration of the case and assign it to a field on the ticket. I'm thinking you could have the case enter a workflow on creation which within the workflow could have the creation date. when the case is closed, the workflow could set the duration field on the case and exit