Expand my Community achievements bar.

SOLVED

Number of tasks in a project

Avatar

Level 2

Hi, has anyone created a calculated field to display the number of tasks in a project?


I can achieve this using textmode (as a new column) but struggling to work out how to 'Count' the number of tasks using an expression.

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Unfortunately, Workfront has limited "count" functions available. I have a column I use with the following code in it:

 

displayname=Total Tasks
linkedname=direct
querysort=totalTaskCount
textmode=true
valuefield=totalTaskCount
valueformat=int

 

I should note, this includes parent tasks. 

 

Otherwise, reversing this as noted by Doug into a task report could work and you could filter out parent tasks if needed. Then group by project and view the summary tab to see how many are for each project.

 

KellieGardner_0-1704405139815.png

 




View solution in original post

5 Replies

Avatar

Level 10

 

Hi @AndyKent,

 

Since each Task has an attribute called Task Number, one way would be to create a Task Report, add the Task Number column to the view and set to show the "Max", then grouped (and sorted) by Project with the grouping set to automatically be collapsed by default: as a result, you'd then see each Project (sorted) with the MAX Task Number (essentially, the count) beside each.

 

Bonus marks...

 

If you instead group by Task Number (descending) and then by Project Name, you can then also add a bar chart by MAX Task Number (i.e. "biggest" projects) to smallest in an interesting ever-shorter-diagonally-down-the-page manner.

 

Regards,

Doug

Avatar

Correct answer by
Community Advisor

Unfortunately, Workfront has limited "count" functions available. I have a column I use with the following code in it:

 

displayname=Total Tasks
linkedname=direct
querysort=totalTaskCount
textmode=true
valuefield=totalTaskCount
valueformat=int

 

I should note, this includes parent tasks. 

 

Otherwise, reversing this as noted by Doug into a task report could work and you could filter out parent tasks if needed. Then group by project and view the summary tab to see how many are for each project.

 

KellieGardner_0-1704405139815.png

 




Avatar

Level 3

This text code is just what i needed, thank you.

 

Do you also have code that covers Issues? I tried to replace the word "Task" with "Issue" but that didn't seem to work.

 

Thanks!

Avatar

Community Advisor

Through the API issues are referred to as OpTask so you'll want to change to totalOpTaskCount

 

displayname=Total Issues
linkedname=direct
querysort=totalOpTaskCount
textmode=true
valuefield=totalOpTaskCount
valueformat=int

 

 




Avatar

Community Advisor

I'm not sure if I've read your question correctly, but if you're searching for a way to create a custom calculated field on the project custom form, that will display number of tasks, this isn't possible.