Getting task creator in Asana API - asana

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.

Related

How to add same set of tasks (as child) to multiple user stories in tfs?

Suppose i have some set of tasks say:-
Analysing Code.
Coding.
Exception Handling.
View Integration
Deployment.
Bug Fixing.
How do i bulk create the same set of tasks under multiple user stories as its respective child objects?
Eg:- say i have
45678,45679,45670,45671,45672 as my user stories.
If i manually create the 6 listed tasks to the 1st user story, then how can i bulk create the same set of tasks to all other user stories as child objects?
There is no automation out of the box for this.
You can use excel to copy/paste the tasks as children of PBI's. There are also some third party tools out there that can do what you want. I built the TFS Event Handler in 2008 for an organization but have not had much call for it since.
http://nakedalm.com/tfs-event-handler-for-team-foundation-server-2010/
The reason I don't get much call for this sort of thing is that if you need it, then you are doing something wrong. Your list above is something that would make a lot more sense on a definition of done than a task list. If this was the DOD then the tasks should be the development teams plan to get them done...

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

Information on new task created in Asana

I am working on an application that needs to take some actions when certain events happen in user's Asana account (such as new task created, new project created and existing task modified). For this I plan to poll the Asana API every 15 mins and check for new activities. At the moment, for new task created event, I am polling the project for all its tasks in one go, but I do not get any time stamp in return. For timestamps I am required to make individual API calls for each task, which will be inefficient and eat into my rate quota.
Could you please let me know what is the best way for me to get information on new task or project created in Asana for a user, without impacting the rate quota a lot?
You can include timestamps and other data using the opt_fields parameter. So for instance, if you just want to know about newly-created tasks, you can use GET .../tasks?opt_fields=created_at,name (assuming you want the name as well).
Hope that helps! (Also, we're working on a subscription system that lets you "listen" to events like task creation, which will be even better - but that's still in the works.)

Asana API roadmap - getting completed tasks (including archived)

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.

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