Henrik Cednert Posted July 19, 2015 Report Share Posted July 19, 2015 Hello Playing with the API but for the love of God I can't figure out how to get the status of a task. First of all, it seems to be a bit confusing what a task is and what a status is and what you see labeled as task in the webUI isn't necessarily a task in the API... So in the webUI we have: PROJECTsequences can be here in project rootshots can be here in projectroot--EPISODES----sequences------shots After a long journey I've iterated over project, sequences and collected all sequences in one FTList and all shots in one FTList. If you look at the attached screenshot. For each shot in my shotFTList I wan't to get: The shots current status, in screen shot "Not started".Each individual tasks name/type and current status. In screenshot. [Grade: Not started], [Compositing: Awaiting approval], [source prep: YES]How do I do this? The whole goal with this exercise is to in the end make an action that I can trigger which will rsync all the shots where 'compositing' task type is "awaiting export" from ftp to san. Cheers Link to comment Share on other sites More sharing options...
Henrik Cednert Posted July 20, 2015 Author Report Share Posted July 20, 2015 Oh... Seems like the only thing missing was another whiskey. Got it working with this... There's some poop in the code here plus the fact that I have no idea what I'm doing.. But it does what I wanted it to so that's good I guess. =) project=ftrack.getProject(projname)statuses = project.getTaskStatuses()print "Project, full name: " + str(project.getFullName()) +"\n"i = 0print "Available statuses: "for status in statuses: print str("%02d" % (i,)) + " " + str(status.getName()) i += 1print ""*2 episodeCounter = 0sequenceCounter = 0shotCounter = 0## ITEMS IN PROJECT ROOT## shots in rootshotFTList = project.getChildren('shot',1)shots = project.getChildren('shot',1)for shot in shots: shotCounter += 1 print " " + shot.get('name') tasks = shot.getTasks() for task in tasks: print " " + task.getName() print " STATUS: " + task.getStatus().get('name') print"" Link to comment Share on other sites More sharing options...
Yas Opisso Posted July 23, 2015 Report Share Posted July 23, 2015 Hi Henrik, Just FYI you can also query the tasks of a specific user by getting the user and then getting his/her tasks. user = ftrack.getUser ('UserName') # This gets the usertasks = ftrack.getTasks(user) # Gets the current tasks for the particular user from here you can get the task statuses by: task[0].getStatus().get('name') PS: I don't realized you answered this already Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.