How do you get the "author" of an Asana task from the API? - asana

Trying to determine who created an Asana task from the API, but:
There's no author field on the task itself.
Followers cannot be used because the creator can remove himself from followers.
Looking at the stories of a task, there is not system event for creation.
The best I've found is to use the created_by field of the first (eldest) story of a task.
Is there a better alternative?

This field is not currently available on tasks, your approach (look at first story) is the best practice at the moment. We'll take this into consideration for future API improvements.

Related

How to order tasks by importance in microsoft todo task graph API?

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.

Is it possible to set category on a Microsoft To Do task using the Microsoft Graph API?

I'm interested in using Graph API in order to manage tasks within MS To do. I've already found documentation for creating a new task.
However, I didn't find anything about the following during a new task creation or task update:
Is it possible to set subtasks on a task?
Is it possible to set a category on a task?
Is it possible to reassign a task?
Maybe someone has information about it.
As of now there is no way you can create sub-task with Microsoft
Graph. There is a feature request already present
here,
please upvote it so that product team may consider it for
development in future.
For category as well we cannot get or set the data as of now. For
this as well there is a feature request
here.
Please upvote it.
For the assignment as well there is a uservoice
here.
Please upvote it so that it may be implemented in future.

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.

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.

Resources