Tk-multi-workfiles2 - Save and set status to 'in progress'

Hi,

Is there a way to automatically set the status of a task to ‘in progress’ once a scene has been saved under that task?

Thanks

1 Like

You could take over the scene_operation_<engine_name>.py hook for the Workfiles2 app.
Then under the save function add your code to change the status of the current task as required.

As Ricardo already mentioned you could use a hook. And then get the task and if it exists, change the status. I recommend creating a framework for that. So that you can re-use the same functionality in different custom apps, not only in workfiles.

Inside the hook, you can use something like this, but I highly recommend adding all sorts of checks for your schema and available statuses.

engine = sgtk.platform.current_engine()
sg = engine.shotgun
context = engine.context
current_task = context.task

if not current_task:
    return False

data = {
        'sg_status_list': 'ip',
    }

sg.update(
            current_task['type'],
            current_task['id'],
            data
)
1 Like