[New] Time tracking entries

Original announcement

Summary

Time tracking entries are now available in the API! This feature allows you to estimate the time needed to complete a task, as well as record the actual time spent. This data helps inform decisions regarding workload and resourcing, provides better information for real-time estimates on project progress, and can inform forecasting and budgeting.

Usage

To perform operations on time tracking entries, you can make requests to the following API endpoints:

Here’s an example of a complete time tracking entry record in the API:

{
  "gid": "12345",
  "resource_type": "task",
  "created_by": {
    "gid": "12345",
    "resource_type": "user",
    "name": "Greg Sanchez"
  },
  "duration_minutes": 12,
  "entered_on": "2015-03-14",
  "created_at": "2012-02-22T02:06:58.147Z",
  "task": {
    "gid": "12345",
    "resource_type": "task",
    "name": "Bug Task",
    "resource_subtype": "default_task"
  }
}

For property descriptions, you can review the schema for time tracking entries.

Special considerations

The following webhooks are emitted when a time tracking entry is added, changed, or deleted:

  • A webhook for the task is emitted for field: 'actual_time_minutes'
  • A webhook for the time tracking entry is emitted
  • After a short time (i.e., to allow for an “undo”), a story is emitted (e.g., Carolyn added 45m to actual time)

Questions & feedback

We hope that by using these new endpoints, you can integrate Asana’s time tracking capabilities with the other tools and workflows you use to track time.

As always, feel free to leave your questions, comments, and feedback here in the forum!

Best,
Andrew

1 Like

Hello,

Are there any plans for supporting PUT/POST for the created_by user? We are looking to sync to Asana from another DB and it would be nice to be able to keep track of who did what & for how long. Please let me know if this is in the scope or if there is a workaround for this feature that I’m missing.

Thank you,

Caleb

Hi @Caleb_VanDerMaas, thanks sharing your feedback and use case. We do not have any plans to add those endpoints. We generally don’t create APIs to change who took actions in Asana. This would create issues around auditing user actions in Asana. You can, however, read the created_by data to keep track of who did what and for how long in Asana.

In terms of a workaround, perhaps you could create a custom field to track the data you care about for the sync with your DB. If you don’t want the data visible in the Asana web app on a custom field, you could use the custom external data endpoint.

While you can’t change user generated authorship, you can create/update time tracking values such as duration_minutes with the API. For example:

curl --request PUT \
     --url https://app.asana.com/api/1.0/time_tracking_entries/1234567890
     --header 'accept: application/json' \
     --header 'authorization: Bearer 0/XXXXXXXXXXX \
     --header 'content-type: application/json' \
     --data 
'{
  "data": {
    "duration_minutes": 12
  }
}'
2 Likes