Hi @Fillipe,
Columns are sections
in the Asana data model. So what you want to do is monitor changes in a project’s tasks and catch whenever a task’s section changes in that project.
Monitoring changes in a project's tasks
This is done either via webhooks or monitoring events.
Note, though: if you’re going to use webhooks, the format of them is changing over the coming month, so rather than using the above documentation for their data format, I’d recommend you set your app in the developer console to only use String IDs:
and then use the new data format that’s described here.
Catch whenever a task's section changes in that project
This is done by monitoring a task’s memberships
array property. (For info, see the description of the memberships property here.) Each membership is a combination of a project and a section in that project. So whenever you get a task-change webhook/event for a project’s task, you would locate the membership array element for that project and grab the section (if any). You’ll need to store those sections in your own data store along with the created_at
timestamp for that webhook/event.
By comparing the section you stored with the current section in the webhook/event payload, you’ll be able to know that the section changed. By using the timestamp you stored vs. the current timestamp of the webhook/event, you’ll be able to calculate how long the task resided in a given section.