Asana Slack Integration - List only my tasks - asana

When I do /asana list I get every task in all projects.
Is it possible to do /asana list #member to show tasks only assigned to me or /asana list To My Tasks to show tasks in a project only? All this without using Zapier?

Related

Get task from several assignee / team

I need to get a list of tasks for several persons (team members).
I see that in the API I can specify one assignee.
Could I specify a list of assignee or a team id to get task related to several members ?
Regards,
Unfortunately, I don't think there is a great way to fetch all tasks assigned to a list of people, or all tasks in a team.
What you can do is:
Multiple Assignees: fetch the tasks for a particular assignee (/tasks?workspace=workspace_id&assignee=user_id&limit=20) and repeat for all users in your list
Tasks in a Team: fetch projects in the team (/teams/:team/projects?limit=20), and then for each project, fetch tasks in that project (/projects/:project/tasks?limit=20)
Please remember to paginate :)

Getting task creator in Asana API

I'm building an Asana API wrapper in python and trying to add functionality to get the creator of a task. As per the suggestion in this question: How to expose asana task creator? I'm loading the stories and inferring it from there but I assumed there'd be a story with the text 'created' as shows up in the web interface but the earliest story I see is always 'added to' then either a tag or project and there is no system story with the text 'created'
Is this the intended behavior of the API?
It's actually not the API but the fact that there actually isn't an event for the task being created - we store the creator and the creation time on the task, so it's kind of redundant (and saves creating a new DB object for every task creation - at scale the little things can add up). In the UI, we show task creation information inline with the other stories, but for the API you should just get that info from the task data itself.

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).

Getting all tasks to which user has access

I'm developing a desktop app with a backend. In the desktop app I just retrieve all tasks assigned to user, but on the web I have to get all tasks (including archived) to which Asana user had an access. Is there a convenient way to do that?
It looks now I have to do so:
Get all workspaces
Cycle though all workspaces and get all tasks.
Get all projects in a workspace
Cycle through projects and get all tasks
? merge tasks from workspaces and projects. This should be done, because the task can be detached from a project.
EDIT:
It seems now is possible to have this way only:
/workspaces
cycle through workspaces to get all projects /workspaces/workspaces_id/projects
cycle through all projects to get tasks /tasks/?project=project_id
You get all tasks user has access to, but without tasks detached from projects (workspace tasks). How to get really all tasks, is a question
Regards,
Victor

Query for open tasks in Asana

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.

Resources