Fernando Posted January 17, 2023 Report Share Posted January 17, 2023 Hello, When I update a task assignee I can receive the following event: {'action': 'update', 'changes': None, 'entityId': '8c59f5de-6465-4144-9296-8990728e2baa', 'entityType': 'task', 'entity_type': 'Task', 'keys': ['userids'], 'objectTypeId': '11c137c0-ee7e-4f9c-91c5-8c77cec22b2c', 'parentId': 'b1278ca3-619c-4743-9252-ffcdfdf1509d', 'parents': [{'entityId': '8c59f5de-6465-4144-9296-8990728e2baa', 'entityType': 'task', 'entity_type': 'Task', 'parentId': 'b1278ca3-619c-4743-9252-ffcdfdf1509d'}, {'entityId': 'b1278ca3-619c-4743-9252-ffcdfdf1509d', 'entityType': 'task', 'entity_type': 'Shot', 'parentId': '98307db5-a299-4421-ac13-e6bdefb857d3'}, {'entityId': '98307db5-a299-4421-ac13-e6bdefb857d3', 'entityType': 'task', 'entity_type': 'Sequence', 'parentId': '571d57d2-0cad-4e38-9883-1707b81861ce'}, {'entityId': '571d57d2-0cad-4e38-9883-1707b81861ce', 'entityType': 'task', 'entity_type': 'Folder', 'parentId': 'b17dfa3f-fd34-47f2-b287-8978601c4f61'}, {'entityId': 'b17dfa3f-fd34-47f2-b287-8978601c4f61', 'entityType': 'task', 'entity_type': 'Folder', 'parentId': '5f90501e-1651-11ed-b371-4e9078e1c474'}, {'entityId': '5f90501e-1651-11ed-b371-4e9078e1c474', 'entityType': 'show', 'entity_type': 'Project', 'parentId': None}]} While I can deduce from the 'keys' value that the userids were changed, the 'changes' value is empty. I was expecting the 'old' and 'new' assigned userids to be stored there. Is there a way for me to retrieve the information of the old and newly assigned user? Cheers, Fernando Link to comment Share on other sites More sharing options...
Erik LaPlant Posted January 25, 2023 Report Share Posted January 25, 2023 Hi Fernando, Thanks for reaching out. Old and new ids are stored in the "data" attribute. I've posted a link to some event code examples below: https://bitbucket.org/ftrack/workspace/snippets/ggyrb/api-example-working-with-events Hope this helps, Erik Link to comment Share on other sites More sharing options...
Fernando Posted January 30, 2023 Author Report Share Posted January 30, 2023 Hi Erik, In your example you are accessing the user who made the change. What I am actually looking for is the new and old assigned user to a task. I now understand that I can find this information in the "appointment" add and remove event that also occur next to the task update entity within the event, but this is a very roundabout way of getting that info (I have to look at a different entity). Shouldn't the new and old user id be in the task update entity since 'userids' is one of the keys? Cheers, Fernando Link to comment Share on other sites More sharing options...
Patrick Boucher ftrack Posted February 15, 2023 Report Share Posted February 15, 2023 Hi Fernando you are correct that `appointment` record creations and deletions is where you should be looking. As for including the ids in the task's update event, I can log this as a feature request on your behalf. Regards, Pat Link to comment Share on other sites More sharing options...
Fernando Posted March 10, 2023 Author Report Share Posted March 10, 2023 Hi Pat, It seems that the Update Task event isn't always generated when you change the assignee of a task (sometimes it is though). So while I would like to make it a feature request to add the old/new user ids in the changes of a Update Task event, it seems that it wont always work. I guess I do indeed need to work with Appointment events instead. Small side note: I never got a notification that you replied to my last message so my apologies for the late reply. Cheers, Fernando Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now