I have created a custom ticket state, called “Completed” of type “Open”. This works fine and can be selected from the front end. In our environment tickets will be changed by agents from open state to Completed state and eventually after some time to the Closed state.
Is there a way to customize reporting to add a date/time stamp when tickets was moved to Completed?
The standard report will show date/time for new, closed and open states (via first response) but how do I add date/time for my own custom ticket state?
I tried the solution you provided, but the trigger fails to set the custom date/time field. I also noticed that when I set the ticket state to “Completed” and update the ticket then the ticket automatically gets changed to “closed”. I do not have any other triggers apart from the default “auto reply” one.
When I delete the trigger, then I am able to select “Completed” state and update the ticket. It will then be saved with state “Completed” As soon as I create the trigger again, the problem above happens again.
Now that’s interesting. Looks like this might be a bug.
I did a very low level reproduction of your trigger and basically just ensured the object existing.
The field is set to nil. Always. Even if it has a value before: