Filter tasks for step type (short_name)?

I want to narrow down the My Tasks list as much as possible in the tk-multi-workfiles2 engine to only present relevant tasks, for example in Nuke, only show me Comp tasks, with certain statuses.

Here’s basically what I want, but the last filter isn’t working obviously, so I need help with the specifics. I assume the short_name variable doesn’t live at this position in the hierarchy or I’m missing some syntax. I can’t figure out how to write it, but you get the idea hopefully. I’m using the short code for the Comp step here, but other software might require multiple task types.

 settings.tk-multi-workfiles2.nuke.shot_step:
      my_tasks_filters: 
        - [task_assignees, is, '{context.user}']
        - [sg_status_list, in, [rdy,ip,fdb,cbb]]
        - [short_name, in, [cmp]]

I’d appreciate any tips on how to write this, and how to figure these things out in the future.

Cheers!

3 Likes

Hi Arvid

So the short_name I think is the issue here. The Task entity doesn’t have a short_name field, the short_name belongs to the Step instead. So you have two options.

  1. Change your filter to work based on the task’s name: - [content, in, [comp]]
  2. Use dot notation to access the task’s step’s shortname field: - [step.Step.short_name, in, [cmp]]

Dot syntax is covered briefly here. Essentially you can use it to navigate through entity fields by providing the {field}.{EntityType}.{field} and it is possible to go multiple levels deep.

You can find out what fields are available and what their code names are via the fields page on your shotgun site, or by using the schema methods in the API.

3 Likes

Perfect! I figured it was something simple, I actually tried a bunch of different dot syntax variants, but not that specific one, that’s what always gets me in the end!

I guess, for me it wasn’t clear from which context I started out in, so I tried Shot.Step.short_name and all sorts of things like that, not sure if I would have figured out to put in the lowercase step. in there. I think I understand how to read the the Fields page now though, so that’s good.

Thanks!

2 Likes