Found in Wu Jingzi's (吴敬梓) Qing novel 《儒林外史》 Chapter 46: '究竟还是意气用事,并不曾报效得朝廷' — 'in the end it was acting on temper, not truly serving the court.' Already a set criticism by the Qing era.
usage
Negative in tone — 'letting hot-headed feelings run the show.' 意气 here is closer to 'temper / pride / momentary passion' than 'spirit.' Common advice frame: 别/不要意气用事. Contrast with 三思而行 (think thrice before acting).