Have validation for active ticket before delete operator or contact

Hi All,

User want to have check function to validate weather have active tickets for contacts/operator prior deletion of contacts/operator. Any idea how can achieved?

Thanks