Can I identify a first publish on event listener?

Enonic version: 7.2.4
OS: Ubuntu


I’d like to know if it’s possible to identify an object is being published for the first time when listening to events.
The objective is to simply fill an attribute if it’s empty on the first publish.

Edit: also, is it possible to know which attributes are being changed?


Event listener (on node.pushed event) will give you which you then will use to fetch full content data via lib-content.get(). When you have content data you can compare value in publish.first field with current date/time to see if it’s the first time the content was published.