Tilt Posted March 10, 2017 Report Share Posted March 10, 2017 I want to move all the timelogs from one task to another task in another project because I want to recreate a project with a dedicated project schema. If I could just change the schema using the new python API that would be great but I think that's not possible so I just created a new project and created new tasks in the browser. But now I want to move timelogs to the new tasks so I can remove the old project from ftrack. My first thought was to just get a timelog from the old task, then append it to the new task's timelogs. But since a TimeLog references a specific context_id I don't know if that's wise or even supported. I wanted to ask how to do it before I do something that might mess with the database in unintended ways: for timelog in old_task["timelogs"]: new_task["timelogs"].append(timelog) Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted March 13, 2017 Report Share Posted March 13, 2017 On 10/03/2017 at 10:38 AM, Tilt said: for timelog in old_task["timelogs"]: new_task["timelogs"].append(timelog) I think the safest approach is to update the context_id: for timelog in old_task["timelogs"]: timelog['context_id'] = new_task['id'] Link to comment Share on other sites More sharing options...
Tilt Posted March 13, 2017 Author Report Share Posted March 13, 2017 Thank you! I'll give that a try Link to comment Share on other sites More sharing options...
Tilt Posted March 13, 2017 Author Report Share Posted March 13, 2017 worked like a charm! Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted March 15, 2017 Report Share Posted March 15, 2017 I'm glad to hear that! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.