Such spasms of the testicle and its moving up slightly can be due to overactive cremasteric muscle,inguinal hernia or testicular torsion. The cremaster muscle is a thin pouch-like muscle in which a testicle rests. When the cremaster muscle contracts, it pulls the testicle up toward the body.Testicular torsion is the twisting of testicles(occurs in young men) and is a medical emergency.
I would suggest an immediate urologist’s evaluation for this.Physical examination and ultrasound testis may be needed to confirm the diagnosis.
Hope it helps. Take care and pls do keep me posted.Warm regards.