My Tasks - Section: Today API

Hey All. thanks in advance and I apologise if this question has been asked before. I can’t seem to find the answer.

So I am trying to create a simple dashboard to view my tasks for today only using the ASANA Api.
So I have read that if I specify the project, I can specifiy the sections ID but…
I want to view all my tasks across all my projects that are not complete and in the “today” section. how do I create that url?

Hi @luckydem and welcome to the forum!

To get your tasks via the API, you’ll want to use the User Tasks List endpoints, which return those tasks assigned to you and showing in your “My Tasks” view:

https://developers.asana.com/docs/#asana-user-task-lists

There is no endpoint which just returns tasks by Due Date, so you’ll need to get a list of all of your tasks via this endpoint:

https://developers.asana.com/docs/#get-tasks-from-a-user-task-list

and then do your own filtering logic to find those that are due today.

Hi @luckydem!

I quickly want to mention that you can also achieve what you are asking for with Bridge24 for Asana.

Hope this helps!
Emilie

@luckydem,

If you weren’t aware, it’s simple to do this right in Asana (no API, no third party tool) using Advanced Search (if you’re on a paid plan):

To get that last parameter for Today/Upcoming/Later, use Add filter in the bottom left and look in the More menu items.

Larry

Thank you kindly for your response.
Maybe this is the same thing but I’m referring to the default sections that Asana provides when viewing “my tasks”, eg: recently assigned | today | upcoming and not for the due date.

With regards the other comments, thanks for the feedback. The reason why I’m creating my own web interface using ASANA’S API is because I have multiple workspaces and I would like to view all my tasks in one place.

It has been done by a few people before and there are a couple of repositories out there that people have shared, but I haven’t found one that works the way I want it to and the chrome extensions that I found didn’t work either.

So… It gives me the opportunity to learn more about APIs and webhooks etc and does a great job of distracting me from my actual work :slight_smile:

1 Like

Ah, OK.

You’ll still want to use the User Task List endpoint, and there’s still no way to filter out tasks that are only in the 'Today" section so you’ll need to retrieve the whole list and do your own filtering.

Here an example of what you might want to do:

GET /user_task_lists/159xxxxxxxxx130/tasks?completed_since=now&opt_fields=name,assignee_status

completed_since=now will filter out completed tasks and give you only uncompleted tasks.

assignee_status is the string value of the section - i.e. "today, “upcoming”, “later”, etc.

1 Like

Hey, I’m doing a similar project as the OP. I’m having a hard time getting only assignee_status=today , are there some tricks or gotchas? I keep getting Upcoming and Later with the response.

Hi @gunniho and welcome to the forum,

What queries have you tried?

Hi @Phil_Seeman!
This one f.ex.:
https://app.asana.com/api/1.0/user_task_lists/3.....0/tasks/?completed_since=now&opt_fields=name,assignee_status&assignee_status=today

It returns my tasks, starting with today, but it will also go into Upcoming and later.

Right - as I said above:

opt_fields is only for telling Asana what fields you want returned; it has no filtering capabilities within it. If you use the user_task_lists endpoint, you’ll have to filter out the today items on your end.

Having said that, it seems like you might be able to use the Search API instead of the user_task_lists endpoint. I haven’t tried this myself, but the Search API has parameters for both assignee and assignee_status, so it seems like you should be able to specify your User guid for assignee and “today” for assignee_status and get what you want. You might want to try that. If you do, please report back and let us know if that gets you what you want!

Got it - big thanks!

1 Like

Unfortunately, this doesn’t seem to work. The assignee_status does not appear to have any meaningful relationship to the section which the task appears within when view the web UI.

Observe: Using the Asana API Explorer, I conduct the following request for one of my tasks:

https://app.asana.com/api/1.0/tasks/123456789123456789


In the response, I see that `assignee_status` is `upcoming`. But the task is clearly within the "Recently Assigned" section of my Asana web UI. It is not in the "Upcoming" section.
  • I then drag and drop the task to a section labelled “Today” within the Asana UI, and then re-send the request. Unfortunately, assignee_status still comes back as upcoming.

  • I create a new section, name it “Today” and move the task to it. Still upcoming.

  • Thinking it may be a caching issue, I updated the notes on the task and resend the request. The notes are updated in the request as expected, but assignee_status is still upcoming.


I create a new task directly within the "Today" section. I then use Asana API Explorer to get the task gid and then run Asana API Explorer again to get information about that task.
  • The task has assignee_status set to inbox. However, that task is clearly within the “Today” section in my Asana web UI. In fact, it was created directly within that section and has never been in any other section.

  • Desperate for any sort of useful functionality/feedback, I set a due date on the task of today, and keep the task in the “Today” section. Resending the request, the assignee_status is still inbox.

  • Then, I use the “Move tasks between sections” button image to move the task to “Upcoming”. Still, the API request comes back with inbox.

  • So, I drag-and-drop the task back to the “Today” section. Still inbox.

  • To test for a caching issue again, I update the notes of the task and make the API call again. The notes are updated, but assignee_status is still inbox.


Sadly, it appears that it is impossible to get tasks marked for "Today" with this method. Yes, some tasks come back with `assignee_status` set as `today`, but when those tasks are moved to a different section, the `assignee_status` doesn't change. The `assignee_status` parameter within the API seems 100% disconnected from the web UI.

My hypothesis is that the latest update to Asana whereby custom sections were added has caused assignee_status to become an orphaned property that is no longer being updated when tasks are moved via the UI.

I see this, now. How disappointing, both in terms of the lost functionality and the failure in documentation.

Yeah, sorry, I was going to post a link to that info earlier this morning but got pulled away from my PC. You found it. :frowning_face:

Also I see you just found the other relevant part of the issue, that getting sections in My Tasks via the API is currently broken…

Agreed :100:

2 Likes

@Brandon4 et all,

This is now resolved!! They’ve just added a new assignee_section property to task objects that are in a user’s My Tasks (“user task list” in technical terms).

It’s an opt-in property meaning you’ll need to get it using opt_fields=assignee-section but it’s there now. It looks like this:

image

cc: @lpb, @Bastien_Siebman, @Frederic_Malenfant, @JFrentz

3 Likes

Good news - the API team just pushed an update and this is no longer the case. assignee_section is now returned by default for tasks in My Tasks, no opt-in needed. Nice!

4 Likes

Great! I’ll use it as soon as possible! Thanks

2 Likes