Very true! The times when I've been happy at work have frequently been when I've failed at basically everything in my job description for the week, but managed to write up a script that automates some horrific process that a colleague I like was forced to do.
Would the organisation actually keep me hired if they knew that was my main output? Absolutely not. Did it make me feel great? For sure! Taking note of those small moments has been helpful in working out exactly what I (and many others) find distasteful about office work.
Some of the "most productive" times I've had were when I was sent to a customer site to diagnose some esoteric issue, and got to watch them actually using our software/hardware, realizing there were some unreported issues that made their life harder but nobody realized, and quietly fixing those (alongside the main issue, which was a configuration edge case) for the next release. Never even hit JIRA, but someone's life was made easier.
Would the organisation actually keep me hired if they knew that was my main output? Absolutely not. Did it make me feel great? For sure! Taking note of those small moments has been helpful in working out exactly what I (and many others) find distasteful about office work.