Vikunja API - List upcoming and tasks done today

Hi, I’m having a hard time using the Vikunja API in order to get a list of tasks.

What I’m trying to do is to get a list of tasks where the due_date is one month into the future. So if you take 2023-02-14 as todays date I want all tasks that have a due_date of 2023-03-14 or less. In addion I want to include tasks that have been marked as done today. So I’ve been trying to add another filter for “done_at”, but it doesn’t seem to work as intended. It seems to work only when specifying the date AND time which isn’t what I want. So I tried to add two more filters that would filter done_at between yesterday and today, but Vikunja seems to parse this as two individual filters giving me everything before one date AND everything after the other. I’ve also tried the filter_concat, but I don’t understand it as it seems to be a atring and not working as an array similar to the other filters.

So in order to summarize:

  • Include all tasks that are due the next month (and all that overdue)
  • Include all tasks marked as done today

I would appreciate any help on this as I’ve been at it for hours

It looks like you ran into the filter limitation. You can do both of these independently but not combine them.

All tasks that are due next month, including overdue:

http://localhost:3456/api/v1/tasks/all?
sort_by[]=id
&order_by[]=desc
&filter_by[]=due_date
&filter_value[]=now+30d
&filter_comparator[]=less
&filter_concat=and
&filter_include_nulls=false

Everything marked as done today where “today” is “some time between 00:00 and now”:

http://localhost:3456/api/v1/tasks/all?
sort_by[]=id
&order_by[]=desc
&filter_by[]=due_date
&filter_by[]=due_date
&filter_value[]=now
&filter_value[]=now/d
&filter_comparator[]=less
&filter_comparator[]=greater
&filter_concat=and
&filter_include_nulls=false

There is an item in the backlog to make the filter logic more flexible.

1 Like