There isn't currently a way to get all subtasks in a project and filter them by completeness in one request. However, you can fetch all tasks in a project (filtered as you desire) as well as their subtasks, by passing in some I/O options.
- Specifically, you could pass
opt_fields=subtasks
which will, for each task result, include the names and IDs of its subtasks.
- If you pass
opt_fields=subtasks.completed_at
you will get completion times of the subtasks.
- If you need extensive information about the subtasks then consider
opt_expand=subtasks
which will return the full record for each subtask, but due to performance you may wish to just pass in the exact set of fields you want.
Note that for large projects this is an expensive request and you may experience timeouts. The iterative approach is better for scalability.
A balance might be to use opt_fields=subtasks
to identify which tasks have subtasks (if most don't), then make separate requests to the /tasks/ID/subtasks
endpoint to get the data for those subtasks.