Expand my Community achievements bar.

SOLVED

Add a column to a task report to display the planned completion date of the first subtask

Avatar

Level 2

Our team captures metadata on deliverables as parent tasks, which are made up of the steps represented by the subtasks. I typically create reports based on the parent tasks to show the status of each deliverable. I'd like to add a column to a report with the planned completion date of the first subtask (the first task nested under the parent task that is displayed in the report). Is this possible? I should also mention that our projects typically contain more than one of these parent tasks, so the first subtask won't always be task No. 2 in the project. 

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi @Shannon_Walker 

 

To do this in a report you're going to have to iterate over the child tasks of each of the tasks you show in the report, and then determine whether to show that row's first child (there is no "firstChild" property, only the collection children)

 

Example:

  • parent A
    • parent B
      • child task 1
      • child task 2

You can use the taskNumber property to show only the first child task: 

valueexpression=if({numberOfChildren}=0 && sum({taskNumber},-1)={parent}.{taskNumber},{name}+" due "+{plannedCompletionDate},"") 
listdelimiter=‍
listmethod=nested(children).lists
valueformat=HTML
displayname=Iterate
textmode=true
type=iterate


This block

  • goes over a list (type=iterate)
  • the list is children (an array of child tasks)
  • as a delimiter we use the zero-width-joiner, basically a space character that doesn't take up space  
  • the value expression says
    • if the current list item has no children 
    • and if the task number of the current list item is 1 more than the parent
    • then print out the name and plannedStartDate

 

 

 

View solution in original post

6 Replies

Avatar

Correct answer by
Level 6

Hi @Shannon_Walker 

 

To do this in a report you're going to have to iterate over the child tasks of each of the tasks you show in the report, and then determine whether to show that row's first child (there is no "firstChild" property, only the collection children)

 

Example:

  • parent A
    • parent B
      • child task 1
      • child task 2

You can use the taskNumber property to show only the first child task: 

valueexpression=if({numberOfChildren}=0 && sum({taskNumber},-1)={parent}.{taskNumber},{name}+" due "+{plannedCompletionDate},"") 
listdelimiter=‍
listmethod=nested(children).lists
valueformat=HTML
displayname=Iterate
textmode=true
type=iterate


This block

  • goes over a list (type=iterate)
  • the list is children (an array of child tasks)
  • as a delimiter we use the zero-width-joiner, basically a space character that doesn't take up space  
  • the value expression says
    • if the current list item has no children 
    • and if the task number of the current list item is 1 more than the parent
    • then print out the name and plannedStartDate

 

 

 

Avatar

Level 2

Nice Sven!  Of course you found a more elegant method. 

 

I hope you're doing well my friend. 

Avatar

Level 6

Hah - small world  
Greetings Teale! And congrats on the new gig!

 

Avatar

Level 2

@Sven-iX amazing, this worked perfectly! I removed the name and "due" for my specific situation—all of the first subtasks in my report are the due date of an initial draft, so I just renamed the column to "target draft due date." Our content managers are going to love this. Thank you! 

Avatar

Level 2

Hi Shannon, 

 

On a task report, I was able to pull the subtasks using the following textmode code in a column. If possible, I suggest using the canStart field also but don't know if your tasks have any dependencies. If they don't, then you won't be able to use that. If they do you can use the first valueexpression below to eliminate all of the subtasks from appearing. Also, you'll notice that I added the Task Number. That's simply for if you can't eliminate all of the subtasks from view, to make it easier to identify which one is first beneath the parent task. 

 

valueexpression=IF({canStart}), CONCAT({taskNumber}, "-",{name},"-",{plannedCompletionDate})

 

valueexpression=CONCAT({taskNumber}, "-",{name},"-",{plannedCompletionDate})
listdelimiter=<div>
listmethod=nested(children).lists
valueformat=HTML
displayname=Sub Task PCD
type=iterate

 

Hope this helps, 

Teale

Avatar

Level 2

Thank you, @TealeMc4! Most, if not all the tasks will have dependencies; most won't have a predecessor, but some might.