How to assign user to project via ftrack_api
1 1

3 posts in this topic

Hi all,

how can I assign a user to a project via ftrack_api?

I tried with:

        session.create("Appointment",
                       {"context": project,
                        "resource": user,
                        "type": "assignment"
                        })
        session.commit()

but I get the following error:

Server reported error: ValidationError(Appointment of type "assignment" cannot be created for "user" and "show")

 

But if I get an existing appointment of a project and inspect the data:

(Pdb) for k in allocation.keys():print k, ': ', allocation[k]
resource :  <User(55095a4c-4839-11e6-a626-005056a745dd)>
resource_id :  55095a4c-4839-11e6-a626-005056a745dd
context_id :  28d104b6-8be5-11e7-a763-005056a745de
context :  <Project(28d104b6-8be5-11e7-a763-005056a745de)>
type :  allocation
id :  0b60299c-a469-11e7-aa6e-005056a745de

the context is a project and the resource is a user.

 

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