Requiring a CF value before a ticket can be resolved

What is the best way of requiring a ticket to have a custom field set to
a value before it can be resolved?

One thought I had was to run a scrip on resolve and set the status back
if the cf wasn’t set. But this still causes the resolve transaction to
be logged, which I would like to avoid.

Thanks in advance,