The SIDDHARTA-2 experiment aims to perform the first measurement of the kaonic deuterium 2p → 1s x-ray transition energy. Such measurement, together with the measurement of kaonic hydrogen 2p → 1s x-ray energy transition performed by the SIDDHARTA experiment in 2011, allows the determination of kaon proton and kaon neutron scattering lengths and represents a fundamental input for the low energies QCD in the strangeness sector theory. The SIDDHARTA-2 experiment is presently installed at the DAΦNE electronpositron collider at the National Laboratories of Frascati, in Italy. In May 2022, the kaonic 4He x-ray transitions measurement was performed by the complete SIDDHARTA-2 setup, by using a gaseous target. The result of this measurement is presented in this paper, with a specific focus on the background rejection performed by the kaon trigger system.