replacement for getDefaultRecipients
1 1

6 posts in this topic

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

Share this post


Link to post
Share on other sites

Hi Tilt, the default recipients should now be automatically added to the note when you create it. Is that the behaviour you want or do you need more control? If you need do set them manually there are some docs here: http://ftrack-python-api.rtd.ftrack.com/en/stable/example/note.html

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1