Irresistible urge to do a thing repeatedly is seen in-
OCD is an anxiety disorder, which is characterized by recurrent, unwanted thoughts (obsessions) and repetitive behaviors (compulsion).
Obsessive - compulsive disorder
Schizophrenia
Schizoaffective disorder
Depression