As the charge moves slowly we can assume that there is no kinetic energy gained by the charge in the process. So in accordance with the Work-Energy theorem work done by all the force on the charge must be zero.
There are only two forces acting on the charge, which implies
Wexternal agent+Welectro static=0
Wexternal agent−20=0
Wexternal agent=20J