0

Query in progress and ready to start tasks for a user

Hi,

I have managed to get all the  tasks in progress assigned to a user, but I'd like to get also the tasks whose status is ready to start in the same query. Is that possible? 

The code that I have so far is:

fields=['sg_status_list','id','entity','project']
filters = [['step','is', {"type": "Step", "id": step_id}],['task_assignees','is', {"type":"HumanUser", "id": user_id}],['sg_status_list','is','ip']]
tasks = self.sg.find("Task",filters,fields)

 

Many thanks

3 comments

  • 0
    Avatar
    Jake Wilson

    I did not test it, but try this (the syntax might be able to be cleaned up or not.  And I'm not sure if the array keys are necessary or not):

    http://pastebin.com/mU5EBBtV

    That will get all tasks assigned to a user that are either ready or in progress.

  • 0
    Avatar
    Gonzalo Moyano Fernandez

    Thanks for the reply. It doesn't work. I get the next error:

    shotgun_api3.Fault: <Fault 103: 'API read() invalid/missing filters array \'values\' (simple condition):\n{"relation"=>"is", "values"=>"ip", "path"=>"sg_status_list"}'>

  • 0
    Avatar
    Jake Wilson

    Try this one.  Still untested on my end.

    http://pastebin.com/10gQ8uvJ

Please sign in to leave a comment.