Calculating the total time to complete a task from its sub-tasks

Hello,

Is it possible to calculate the total time estimate for a task from it’s sub tasks?

So I can create a custom field to record the estimated time to complete each sub-task. Then what I’d like to do is iterate through all the sub-tasks for a given task to determine the total time to complete a task. This would need to work at any level in the task hierarchy. I was wondering if there’s a possibility to do this programmatically?

I hope this explains it:

Task 1 - 9 Hours (Calculated)
Sub Task A - 4 Hours (Entered value)
Sub Task B - 3 Hours (Entered value)
Sub Task C - 2 Hours
Task 2 - - 9 Hours (Calculated)
Sub Task A - 6 Hours (Entered value)
Sub Task B - 3 Hours (Entered value)

Total time: 18 hours (Calculated)

But this should work no matter how many levels there are in the task hierarchy.

Steve

You could definitely do this programmatically via the Asana API. The specifics would depend on your exact environment and programming language but you could pretty easily write code to iterate through a task and its subtasks, get the values of a numeric custom field and sum them up. You can post the specifics of your environment in the Developers & API Community section for further assistance.

One important thing to note, though you may also know this, is that since (a) a custom field is only accessible on a task if that task is assigned to a project which has that custom field attached to the project, and (b) subtasks do not inherit the project of their parent task, this means you will not see a custom field on a subtask by default. In order to enter the Hours on subtasks as in your example, those subtasks will need to be assigned to a project which has the Hours custom field attached to it.

Hi Phil,

Thank you so much for your prompt and thorough reply.

I’m not sure what you mean by my environment, I’m just using Asana from a browser.

I’m also not that familiar with Asana, just getting started, so I didn’t know about the custom field not being inherited. I assume I can create a project template with the custom field set so that all tasks will automatically acquire the custom field automatically. I also assume that if I always create new projects from that template the custom field will always be applied to each task.

I can also see a problem with my idea, which is there needs to be some way to determine which tasks are bottom level as they are the only ones which should receive a manually entered value.

I’m really surprised most project management tools don’t seem to have this feature, I thought it would be more or less the default.

I’m not sure how to get started with development in Asana, though I am a developer, are there some good resources for how to get started?

Best Regards,

Steve

Sorry, I meant your development environment - what platform and language you’d be using if you were to program against the Asana API.

Yep! If you make a custom field available in a project, and then you turn that project into a template, then any project you create from that template will have that custom field already attached to it. And when a custom field is attached to a project, all tasks assigned to that project have that custom field available to them.

The biggest drawback to assigning subtasks to a project (which, again, you’d have to do in order to enter Hours custom-field values in them) is that they then show up in the task list for that project, right alongside the top-level tasks.

Of course {shameless plug} there’s a great solution to that issue which is to use my upcoming Desksana application which displays subtasks, to all subtask levels, in a true outline view. And while it’s not in the initial app yet, one feature on the road map is the ability to have it automatically calculate and display totals from numeric custom fields, which is really exactly what you’re wanting. :slight_smile:

The best way to get started is to read the Asana Developer documentation; I think it does a good job. What language would you be developing in? Hopefully it’s one of the languages for which there is a client library available.

1 Like

Hi Phil,

Thank you for your reply.

I think I must be missing something when you say assigning subtasks to a project, I thought they’d be assigned to a task. I’m able to add subtasks to a task by clicking the ‘subtasks’ button in the task details. In order to see the subtasks, I need to drill down and look at each one individual from the task details pane.

I’ve done a lot of jQuery so Javascript would probably be the best option looking at the client library.

Nothing wrong with a shameless plug :slight_smile: It’s a great idea but I’m afraid I wouldn’t be keen to have to install the app on every machine and lose the advantages of a web app.

Once again, thank you so much for your help.

Best Regards,

Steve

Hi I am not sure if this was really solved yet, I am a kinda young project manager and experienced in Jira and git but not in Asana so far. I am troubleshooting atm with the problem that I would like to let Arsana + Everhour calculate my sub tasks of a sub task together e.g.

Epic + **no estimate ** + assignee: Me
sub task 1.0+ no estimate + assignee: Me
sub task of sub task 1.1 + estimate 1h +assignee me
sub task of sub task 1.2 + estimate 1h +assignee me
sub task 2.0+ no estimate + assignee: Me
sub task of sub task 2.1 + estimate 1h +assignee me
sub task of sub task 2.2 + estimate 1h +assign me

in my opinion, it should calculate after creating all tasks something like that:

Epic + 4h estimate ** + assignee: Me
sub task 1.0+ ** 2h estimate
+ assignee: Me
sub task of sub task 1.1 + estimate 1h +assignee me
sub task of sub task 1.2 + estimate 1h +assignee me
sub task 2.0+ 2h estimate + assignee: Me
sub task of sub task 2.1 + estimate 1h +assignee me
sub task of sub task 2.2 + estimate 1h +assign me

so Everhour and Asana should calculate on its own the estimates for each sub-task together and bring them together in the epic…is that somehow possible?
in the e.g. the epic is 4h in sum and each primary subtask is 2h because of its child subtask which is each 1h. I would love to know if it’s possible and if how.

Hi, Waclaw from Everhour is here to shed some light for you!

The calculation works 50% how you describes it. The grand total for epic (parent of all parents) will have its estimate as 4 hours (sum of estimates from all level subtasks).

The 1st level subtask estimate will be 0. This is so, because there are some technical challenges right now to capture the subtask total when it is parent to other subtasks.

Let me know if you have any other questions about Everhour!