Event daemon trigger only once - upon Version Creation?


I’m trying to make an Event Daemon so that upon a Version creation, it changes the ‘Status’ field’s value to ‘reference’, which I was able to do using ‘sg.update(…)’.

BUT, I want this change to to the ‘Status’ field to happen only once upon creation of that Version and NEVER AGAIN for that particular Version.

Is there a way to do this? If so, what’s the code to make that happen?

Some help would be appreciated.

Thanks in advance.

You should read through the documentation. You need the event type “Shotgun_Version_New”, which only fires when the version is created.
If you do not listen to update events, then nothing will happen.

Conversely, if you have other Shotgun_EntityType_Change type events running, and you do not want them to run when the changes are happening at creation time of a new entity, each change EventLogEntry will contain the following in the metadata: in_create: True which can be used when filtering events on the plugins.

Also if you want every Version to be set this status initially it may be worth simply updating the default value for the status field settings via the web UI.