Remus Avram Posted September 28, 2017 Report Share Posted September 28, 2017 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. Link to comment Share on other sites More sharing options...
instinct-vfx Posted September 29, 2017 Report Share Posted September 29, 2017 You are trying to create an assignment where i think you should be creating an allocation, no? Link to comment Share on other sites More sharing options...
Remus Avram Posted September 29, 2017 Author Report Share Posted September 29, 2017 Right! Thanks @instinct-vfx! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.