Asana API roadmap - getting completed tasks (including archived) - asana

Do you plan to add possibility to retrieve (via API) all tasks from project including those which are archived?

(I work at Asana)
That would be a useful feature and we are already planning on adding it. However, I can't comment as to when it will be possible.

Until the API officially supports this, you can always query /tasks?completed_since=now to get only incomplete tasks, then query /tasks, and filter for tasks that only appear in the second list.

Archived tasks can be accessed by including the parameter ?include_archived=true in your request for querying tasks by project.
Task section in Asana documentation

I am trying to do this exact same thing as well. We are using a project to track line down events on our manufacturing floor. I found this post helpful and you can append “?include_archived=true” to your query but I found out that you can also do a reverse lookup on tasks by their tag. This will also show achieved tasks as well.

Related

Get all planner tasks created by an user

I want to get all tasks my user created.
I tried to use https://graph.microsoft.com/v1.0/drive/root/createdByUser/planner/tasks endpoint in the Graph Explorer, but I got error 500 (internal server error).
The official documentation is here: https://learn.microsoft.com/en-us/graph/api/planneruser-list-tasks?view=graph-rest-1.0&tabs=http
Do you have any suggestion how I can get all the planner tasks I created?
Tasks created by a user is not a supported query. People can lose access to tasks that they have created (e.g. if they are removed from groups). The closest operation you can do is to loop over the plans in the groups you are a member of, read the plans in those tasks and see which ones were created by your user. The API linked in the question will return the tasks assigned to you.

Asana API - get all tasks and completion status

I am trying to use the Asana API to get all tasks within a project, as well as whether they have been completed. This seems to require the use of the opt_expand parameter, but I am having no luck with the following URL (and combinations of it): https://app.asana.com/api/1.0/projects/XXXX/tasks?limit=10&fields=completed&opt_expand=completed. Is this possible with the Asana API currently?
You need to use the opt_fields parameter in your GET request. Asana does not support generalized queries like completed=true. However, you can query for all tasks for a particular project and then filter the tasks by their completed_at value. The completed_at field will return a read-only time (e.g.'2012-02-22T02:06:58.147Z') of when the task was completed or null if the task is incomplete.
To return all tasks related to a project, including if they are complete, use this GET request: /projects/XXXX/tasks?opt_fields=name,completed_at.
For your reference, you can specify the options you want returned by using the parameters outlined in the Asana Input/Output Option docs. Also make sure to read the Asana Tasks docs to see which fields are available for the task resource.

ASANA API - get only projects associated to me

when you query /projects I get every project in the organization(a-lot) ... is there anyway to just get projects that I am interested in (ie task assigned to me, mention of me, or one that I have flaged as following?)
I have also tried
users/me/projects
projects?followers=me
That's a really interesting idea. We don't currently have a way of doing that - even in the product! - in part because everyone's definition of "interesting to me" is a little different. For instance, there's no global way to look up, for a user, all the comments they're mentioned in - mentioning adds a user as a follower to the task, sure, but they might be removed from the followers list subsequently. Should projects with tasks that I hearted be included? What about projects with tasks that have comments that I hearted? Projects with tasks that I'm following, sure - but what if the last time I followed a task in that project was over a year ago, and the task I followed is long since complete? Since tasks can be in multiple projects, does it make sense to include a project that I may have never even seen, but includes a task that's also in a project I work on, and so I've touched it? It's a tricky question to get right for everyone, to be sure.
In the meantime, you can get tasks that are assigned to you in a workspace (GET /tasks?workspace=[id]&assignee=me) and then crawl all the tasks to find the projects they're in (I know, not terribly elegant).
We currently don't expose projects/tasks you're following or projects you've favorited (starred) via the API. And as far as I know there's no way to query stories/tasks you're mentioned in via the API or the app.

How to rearrange subtasks using API?

I created some sub tasks using the following API. But any new subtask I create, is getting added to the top of the subtask list in asana website.
I want the newly created subtasks to be at the end of the list. How to rearrange or to append to the list?
https://app.asana.com/api/1.0/tasks/12844760163515/subtasks
Currently this isn't supported via the API - we have plans to support something like the insert_before/insert_after parameter similar to on the task/addProject endpoint, but for subtasks.
It's not currently scheduled work, though I've added a note to this question so we can take that into account when prioritizing API work (and make notice when we ship it).

Get archived tasks from asana

We are trying to get the tasks from Asana using the Asana API to create a customized dashboard. But we couldn't get archived tasks using the API.
Is there anyway to get all tasks including the archived tasks using the API?
If this feature doesn't exist will it be added in the upcoming releases?
Thanks in advance
There's actually a flag, include_archived that you can set to true, which will cause a query for tasks to (you guessed it!) include the archived tasks as well. See https://asana.com/developers/api-reference/tasks for more details (esp. the "Querying for Tasks" section).
Hope that helps!

Resources