If this is not the right place, apologies.
I'm finding an inconsistency when running this code in Jenkins' Script Console (url /script) and in a workflow job:
When running from the console:
When running from the job:
The collect method seems to operate only on the first object. Didn't find any obvious reason to why - the Groovy library seems the same.