0

Query all statuses for a task

I am trying to find out all the valid status for a given task not just the current status name but all status options for a given task via Python api. I can't figure out how to do it. If I do the schema_field_read I get all the status including the hidden and one that belong to Assets or other Entity. Would love get some insight on how to do this :)

4 comments

  • 0
    Avatar
    Ben Zenker

    Kartik,

    Are you saying that you want a list of just the visible statuses (sg_status_list) relating to the Task Entity?

  • 0
    Avatar
    kartik sundarajan

    Hi Ben,

    Yes that would be correct. Right now we do

    sg.schema_field_read('Task', 'sg_status_list')

    and then use the display_values but this shows all the status.

  • 0
    Avatar
    Ben Zenker

    So it appears that there is a key 'hidden_values' that contains a list of hidden statuses. You could use that list to filter out the hidden values from the list of 'display_values'. 

    Additionally, when I first tried this, 'hidden_values' was empty but when I supplied a project to the schema read it worked.

    sg.schema_field_read('Shot', 'sg_status_list', {'type':'Project', 'id':117})

     

  • 0
    Avatar
    kartik sundarajan

    Yes, but it seemed messy that why I was wondering if there was a cleaner way. But if that is only way to do then we will just go ahead with that.

Please sign in to leave a comment.