  Using the chiral unitary approach in coupled channels and $SU(3)$ symmetry we
describe the production of $f_0(500)$, $f_0(980)$ and $a_0(980)$ in the
$\chi_{c1} \to \eta \pi^+ \pi^-$ reaction, recently performed by the BESIII
collaboration. A very strong peak for the $a_0(980)$ can be seen in the
$\eta\pi$ invariant mass, while clear signals for the $f_0(500)$ and $f_0(980)$
appear in the one of $\pi^+\pi^-$. Next, we make predictions for the analogous
decay $\eta_c \to \eta \pi^+ \pi^-$, which could also be measured
experimentally. We discuss the differences of these reactions which are
interesting to test the picture where these scalar mesons are dynamically
generated from the interaction of pairs of pseudoscalars.
