Jump to content

replacement for getDefaultRecipients


Tilt

Recommended Posts

I'm migrating our last bits of code from the old API to the new one. Is there a replacement for .getDefaultRecipients() when adding notes to asset versions? That function seems to be missing. Do I just look for all users assigned to the task and add them as recipients manually?

cheers

Stefan

Link to comment
Share on other sites

  • 4 weeks later...
  • 8 months later...

Sorry to resurrect this old thread... getDefaultRecipients was a really nice thing in the legacy API. We're searching for a workaround for this use case: A note should get created on an asset version but not only the default recipients should get it. For example, we might want notes to a lighting task asset version also be sent to the artist assigned to the comp task. Previously, I used the result from getDefaultRecipients (which included all managers) and added the user that was assigned to comp.

Now that is no longer possible, because create_note() will override the default recipients if I manually add some. Managers are also not implemented in the new API yet (and I remember reading that it's not on the todo list) so I can't just add the managers in the create_note() call myself.

Are there any workarounds? Is it possible to somehow "trick" ftrack into considering a certain user as part of the default recipients? Maybe using links?

cheers

Stefan

 

Link to comment
Share on other sites

16 hours ago, Tilt said:

Are there any workarounds? Is it possible to somehow "trick" ftrack into considering a certain user as part of the default recipients? Maybe using links?

 

It might be worth testing:

# Create note, do not commit or pass recipients
note = asset_version.create_note(...)

# Create recipient, but do not add it to the note collection.
session.create('Recipient', { 'note_id': ..., 'resource_id': ... })
session.commit()

It might work but I cannot guarantee that it will keep working.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...