Let say I have a Hamiltonian system $$ \begin{align*} \dot p &= -H_q \\ \dot q &= H_p \end{align*} $$ with Hamiltonian $H(p,q)$, coordinates $q \in \mathbb{R}^2$ and momenta $p \in \mathbb{R}^2$. I know, that the system possesses a first integral $f(p, q)$: $\{f, H\} = 0$.
Am I right, that there exists a canonical transformation $(p_1, p_2, q_1, q_2) \mapsto (\xi_1, \xi_2, \eta_1, \eta_2)$ s.t. dynamics for subsystem $\xi_1, \eta_1$ are getting trivial? Something like $$ \begin{align*} \dot \xi_1 &= 0 \\ \end{align*} $$ If so, what the generating function will be?