Event Log: New Version Events missing

Hello,
I need to trigger some actions whenever a new version is created for tasks on an asset.
Example: do a turntable render every time a new version of the model is published.

Unfortunately the Events Log seems to register only changes to versions (Shotgun_Version_Change) and not new versions created.

I am building a demo of a product for VFX and Feature Animation that I have integrated with Shotgun and this feature is key to show the potential to the prospect clients.

Thanks,
Marco.

Hello,
I run further tests and I can confirm that adding the Version via Shotgun UI registers the right Shotgun_Version_New event in the log, followed by Change events.
Unfortunately, doing the same via the Python API does not produce the same effect.
This is an excerpt of the code I am using:

sg = shotgun_api3.Shotgun(SG_URL, script_name=SG_SCRIPT, api_key=SG_KEY)
versionData = {"code": name, "entity": link, "project": project}
newVersion = sg.create("Version", versionData)

Will keep investigating, but it would be helpful if I could get some hints.
Thanks,
Marco.

Just found thi spage, which mentions that I might have to create my own events to log from my application: https://developer.shotgunsoftware.com/python-api/event_types.html

Is there any way that I could rely solely on existing Shotgun events triggered by my application?
Thanks,
Marco.

Shotgun_Version_New works fine here… and our versions are created from programs.
Did not completely understand - you are saying that when you create the version programmatically, you get no event at all?

When I create the Version from the Shotgun web app I get the New and Change events.
When I create the version using sg.create(“Version”, data) I don’t get any Event at all.

The only solution I found this far is to use sg.create(“EventLogEntry”, eventData) after sg.create(“Version”, data) is successful.

Is this the only way, or is there a way to generate the event automatically on sg.create ?

I don’t think there is intended to be any difference at all between manual and automated creation.
Could be a bug.

Are you using script-based authentication? If so, be sure you have the “Generate Events” field selected for that script.

CleanShot 2021-04-07 at 09.59.09@2x.

If it’s not selected, your script won’t generate events. This was added a long way back to help reduce the amount of events generated by active scripts where the events were not of any consequence.

cheers,
kp

4 Likes

Thanks a lot Kevin!
I guess things have changed in the past 12 years :sweat_smile:

1 Like

I confirm everything works properly.
Thanks again!

Oh cool, did not realize that existed!