Get all objects from User Groups
0

2 posts in this topic

Hey 

I was wondering if one can get all Tasks/Versions etc by a group name if any assignee is in that group...
 

GROUP_NAME = "Ape"
test = session.query("AssetVersion where task.assignments.resource.memberships.group.name is {}".format(GROUP_NAME)).one()

This results in a 
 

KeyError("Multiple schemas [u'Group', u'User'] found for relationship memberships.")

Can I narrow down that I only want type group ?

Cheers

Johannes

Share this post


Link to post
Share on other sites

Hi Johannes,

Towards the bottom of this page (search for "subclass") we show some examples of casting a result to a single type:

https://help.ftrack.com/en/articles/1040506-query-syntax

In your case, I believe you query string would be:

"AssetVersion where task.assignments.resource[User].memberships.group.name is {}"

 

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
0