LiquidPlanner Classic Forum

Ask a Question
Back to All

upcoming tasks for multiple members

Posted on behalf of Ricardo Signes. Original posting date 2017-07-11.

I want to track how much work is in various states. Namely, per member:

  • how many tasks in the inbox with no estimate
  • how many tasks in the inbox with an estimate
  • how many tasks in the "urgent" package

The "urgent" package is near the top of tree, so I know that if I start from "the top" I'll get to the end of urgent pretty quickly. So, the simplest thing, which I already use when individuals ask for this data, is to get upcoming_tasks with a high-enough limit that I'm sure to get all their tasks.

This is no good, though, when I want to get a report across all members. It's far too slow. There are 27 members, and each one takes several seconds. It takes me two minutes to run the program. The upcoming_tasks endpoint seems only to work for one member at a time (which seems fine), and I've been trying to get the same data another way.

I'm getting /tasks?filter[]=done is false&limit=500 and then pulling the data out of that. I'm not entirely confident in this. Once I'm limiting, I want to know that I've got the data sorted usefully. I'm not sorting, here, because my only remotely plausible order is "earliest_start," but inbox tasks have no start date. I can't tell whether the natural ordering is sufficient: will it list items in their display order? The program, written this way, takes about 15 seconds.

Ideally, I would be able to write a query that said:

/tasks, (contained in INBOX or contained in Urgent) AND is_done is false AND (member_id in LIST-OF-IDS)