Available on Asana Enterprise and Enterprise+ tiers. You must have edit access to the project to create or modify rules.
You can automatically log time entries in Asana by using script actions within project Rules to programmatically record duration when a task moves to a specific section.
Automating time tracking ensures that your team's effort is captured accurately without the manual overhead of logging minutes for every routine task. By leveraging script actions within Asana Rules, you can programmatically create time entries—for instance, logging 15 minutes of "Quality Assurance" time whenever a task enters the "Testing" section.
Note
API limitation: The Asana API allows you to create, retrieve, and delete time entries. However, it does not support starting or stopping the live timer (the "Play/Pause" button) programmatically.
If your organization has the Timesheets and budgets add-on, you have access to extended metadata. This allows you to define if the time is billable and add a specific description to the entry.
JavaScript
async function run() {
// Make an API request to get the triggered task and wait for the response
const task = await tasksApiInstance.getTask(task_gid);
// Print the task's name to see it in the run history.
log("task's current name: " + task.data.name);
let body = {
"data": {
"duration_minutes": 15,
// Attribute to the parent project
"attributable_to": task.data.projects[0]?.gid ?? null,
"billable_status": "billable",
"description": "Automatic log: Section transition processing",
}
};
await timeTrackingEntriesApiInstance.createTimeTrackingEntry(body, task_gid).then((result) => {
log("API called successfully. Returned data: " + JSON.stringify(result.data, null, 2));
}, (error) => {
log(JSON.stringify(error.response.body));
});
}
// The script must end with returning a Promise via run().
run();
On Advanced or Enterprise tiers without the Timesheets add-on, you can still automate time logging. While you cannot set a "billable" status or a description, you can successfully log the duration to the task.
async function run() {
// Make an API request to get the triggered task and wait for the response
const task = await tasksApiInstance.getTask(task_gid);
// Print the task's name to see it in the run history.
log("task's current name: " + task.data.name);
let body = {
"data": {
"duration_minutes": 15,
}
};
await timeTrackingEntriesApiInstance.createTimeTrackingEntry(body, task_gid).then((result) => {
log("API called successfully. Returned data: " + JSON.stringify(result.data, null, 2));
}, (error) => {
log(JSON.stringify(error.response.body));
});
}
// The script must end with returning a Promise via run().
run();
|
Feature |
Timesheets & budgets add-on |
Standard time tracking |
|
Log Duration |
✅ Supported |
✅ Supported |
|
Add Description |
✅ Supported |
❌ Not Supported |
|
Set Billable Status |
✅ Supported |
❌ Not Supported |
|
Attributed Project |
✅ Supported |
❌ Not Supported |
To ensure reliable script performance and accurate data logging, follow these technical requirements and best practices:
console.log() to output variables during the setup phase. You can view script logs within the Rule History tab to confirm that the script is successfully receiving the intended taskGid.Learn
For further technical exploration, refer to the Asana Developer Documentation for Time Tracking.

These cookies are strictly necessary to provide you with certain features. For example, these cookies allow you to access secure areas that require registration and set your privacy preferences. Because these cookies are essential to providing services to you, they cannot be disabled. You can set your browser to block or alert you about these cookies, but it may cause some parts of the site to not work.
Third party trackers collect information used for analytics and to personalize your experience with targeted ads. Under the Virginia Consumer Data Protection Act, you have the right to opt-out of the sale of your personal data to third parties. You also have the right to opt out of targeted advertising related processing. You may exercise your right to opt out of the sale of personal data and targeted advertising by using this toggle. If you opt out, we will not be able to offer you personalized ads and we will stop sharing your personal information with third parties. For more information please see our Privacy Statement.
These cookies allow us or our third-party analytics providers to collect information and statistics on use of our services by you and other visitors. This information helps us to improve our services and products for the benefit of you and others.
These cookies, provided by our third-party advertising partners, collect information about your browsing habits, as well as your preferences for various features and services. They also provide us with auditing, research, and reporting to know when advertising content has been displayed and how successful the content has been. This information allows us and our third-party advertising providers to display relevant advertising content.
These cookies provide enhanced functionality, providing chat support, allowing you to more easily complete forms, personalizing content to your preferences, and selecting your communications preferences. If you do not enable these cookies, or choose to disable them in the future, that could impact your ability to use certain features.