Best way to assign version uploads to respective playlists

Hi!
I have a shotgrid event daemon setup with a very simple python plugin for status flipping, but now i’m trying to setup another plugin.
I have a custom entity with several entries, and each of them has their own playlist assigned to them. I would want a script that automatically assigns all version uploads to that custom entity to the playlist as well, what would be the best way to go about it? The API documentation is huge and i’m confused in how i grab the correct playlist for each of the custom entity entries?
Can i just readout the link?
Thanks!

Not entirely sure I understand but sometimes its good to break things down step by step.

You have multiple custom entity records, each of them has a link to a Playlist?
You want to link any version that is linked to the Custom Entity record to its linked playlist?

  1. Process the version as event
  2. Find the entity link of that version
  3. If the entity link of that version is something we are interested in, proceed
  4. Find out if the entity link has a playlist assigned, query for that playlist
  5. if you found the playlist, update the versions “playlists” field with the link to the entity’s playlist

Something like that?

1 Like

OH that makes absolute sense, thanks for the breakdown help! I guess i was seeing the issue from a way too big point of view. This is much easier to follow :3

1 Like