I am using Asana REST API for connecting Asana tasks with our app. I would need to query for a task from our app, but I don't know in which project to search for that task. Is there a way to query for all tasks in a specific workspace?
As I can see from the documentation it is only possible to search in a specific project:
https://asana.com/developers/api-reference/tasks#query
If you need users to search for a task by name in your app, you should use Asana's typeahead search API. It provides search for objects from a single workspace. This endpoint should be used to query for objects when creating an auto-completion search feature. This API is meant to provide results quickly and should not be relied upon for accurate or exhaustive search results.
There is no single query to return all tasks in a workspace. As workplaces have many thousands of tasks, this query would be too broad (and too expensive).
Related
I'm trying to programmatically retrieve the same information which the Microsoft ToDo desktop and mobile app display.
While I'm able to load the tasks, I'm not able to retrieve them in the same order.
In the app you can sort by importance, which probably uses some internal priority, which is adapted if you move tasks around.
I can't find such a field in the API specs though:
https://learn.microsoft.com/en-us/graph/api/resources/todotask?view=graph-rest-1.0
Is there any way to retrieve this kind of sorting as well via the API?
E.g. I saw that for the planner and its tasks there's an orderHint, I guess I'm looking for something like this:
https://learn.microsoft.com/en-us/graph/api/resources/plannertask?view=graph-rest-beta
By the importance field, you could use OData params filter or orderBy by "importance" column, as per the example below:
Although, I strongly believe you don't want "importance" ordering, but the custom order as you've mentioned "if you move tasks around", for this, I have raised a detailed question here: How to get and set custom order on MS To-Do using GraphAPI mentioning how To-Do application works, with the "OrderDateTime" field.
I would like to retrieve a list of all Planner Plans and number of tasks in each Plan. Goal is to understand which plans are actually in use. I used the Graph API for this. However it appears that most the Graph endpoints for Planner and Tasks use Delegation Permissions. In other words, I have to be part of each Planner Plan to even query for it. So even as Global Admin I am unable to pull this information. Is there any way to query for
List of ALL Planner Plans in the tenant
Owner for each Planner Plan
Number of tasks in each Plan
Thanks in advance,
Jake
You can now use application permissions to read this data.
Outdated reply:
Unfortunately it is not possible to get this through Microsoft Graph
API right now. However we do have another API, which is meant for
admins to be able to export their tenant's data, and it can be used to
get this information. You should contact support for this process.
I'm trying to build a query to retrieve the tasks of project that contains an specific tag.
I'm being able to retrieve the tasks of a project or to retrieve the tasks that contains an specific tag, however I wasn't able to find a way to combine those.
As workaround I'm retrieving all the tasks of the project and doing the filtering on my own; however that won't scale with a project with many many tasks.
Currently you can filter by project OR by tag, but the Asana API does not yet offer a more advanced search or way of combining filters. I agree the best way to achieve this currently is to fetch the set of tasks by either project or tag, whichever set is smaller, and then do the filtering on your own.
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.
We're looking at using Asana to combine CRM, administration and issue tracking in a web dev firm. The key feature we need is a view of the "next actions" or "top [1|2|3] priorities" across all projects in a workspace, irrespective of who they are assigned to. It seems Asana does not provide this out of the box (is that right?) so I am looking into writing API queries to pull this out into a dashboard of our own.
I understand you don't want to let people pull ALL tasks in one workspace, as it may grow, but is there a way to pull out the top few open tasks in each project, without having to specify the assignee?
(I work for Asana)
Currently, the API allows you to grab all tasks in a project, see https://asana.com/developers/api-reference/projects. It will return them in ranked order (the same as they would show up in the Asana UI), however it won't limit them to some number; you'll have to get them all. Limits and pagination are on our roadmap to enable developers to work more efficiently with larger projects and workspaces.
So, it seems like you'd want to grab all projects, then iterate through them and query all tasks - this will give you their name and ID by default. If you want more detail for the ones you're going to show, then I recommend querying the details on each of those tasks individually.