We have Email-to-case implemented which is assigning new cases to a Queue. Now whenever a user opens a new case, it should be assigned automatically to that user. For this I have written a VF page with a Controller. As soon as a user opens a case, the controller changes the Case owner to that user. So far so good!
Now, user should also be able to re-assign the case back to the queue (for somebody else to pick up or any other reason). But when he re-assigns, the same controller assigns it back to the same user immediately. This is happening because the case re-opens after owner is changed to the queue and thus the VF controller executes.
Is there a way I can get around it?