Query tasks by team