Show Plan progress based on the Time Spent of child tasks

Modified on Mon, 30 Jan, 2023 at 5:59 PM

In this article, we will review the process of demonstrating the progress of a Plan based on "Time spent -Remaining estimate" of child tasks.





We already described how to calculate the progress of work items in these articles:


  • Calculate the item progress from time estimates: click here
  • Calculate epic progress based on child items: click here



But now we need to combine both WIs and Plans, so let's figure out how to do it.



In order to show Plans progress, we will use IPlanStatistics class for the Polarion system.

Note: all available methods for this class are listed in their documentation: click here


With IPlanStatistics we can show on the Gantt Chart the same data which is shown in the Plan's "Statistics" section.






As we combine both work items and plans for this configuration, one additional condition should be added in both parts before WIs and Plans section:

if(wi!=null) and if(plan!=null)


We should use this condition to help the system understand that we combine different types of data and it should consider both of them.



To show the Plan's progress put the following script in the Item Script field:

if(plan!=null) {
    var s= plan.getStatistics();
    var progressString =  s.doneAsString()  +" | " + s.todoAsString() +" ("+  s.progressAsString() + ")";
    task.getFields().put("progressString", progressString);
}


As a result near the Plan task on the Gantt Chart, we'll see the Time Spent, the Remaining Estimate, and the Percentage of the Plan's Completeness based on its children. 





One important detail to mention:


In order to make sure that Plan shows progress correctly, you need to start the Plan before you start working on the work items.



In case you don't start the Plan you'll face the following situation: the progress of WIs is calculated, but not shown on the Plan task.


And if you decide to put the Plan to "In progress" right now, and change the time spent on WI (in this case we added 1d to the time spent for "test wp3"), you'll see that only this change is shown on the Plan task.





That's why we highly recommend paying attention to this detail to prevent your project from any contradiction between Plan and WIs.






In case of issues, please send a message to: support@nextedy.com 








Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article