Imagine you want to calculate the progress of the Epic as % of resolved vs all child stories.
- Advanced > Gantt Config Script
gantt.templates.rightside_text = function(start, end, task){
return (task.progress > 0 ?"Progress: <b>"+Math.round(task.progress * 100)+" % ("+task.fields.progressString+")</b>":"");
};
return (task.progress > 0 ?"Progress: <b>"+Math.round(task.progress * 100)+" % ("+task.fields.progressString+")</b>":"");
};
- Advanced > Item Script:
var allitems = trackerService.queryWorkItems("PLAN:("+plan.getProjectId()+"/"+plan.getId()+")","id").size();
var openitems = trackerService.queryWorkItems("PLAN:("+plan.getProjectId()+"/"+plan.getId()+" ) AND HAS_VALUE:resolution","id").size();
if(allitems>0){
task.progress = openitems / allitems;
}else{
task.progress = 0;
}
task.getFields().put("progressString", openitems +" / " + allitems +" done");
var openitems = trackerService.queryWorkItems("PLAN:("+plan.getProjectId()+"/"+plan.getId()+" ) AND HAS_VALUE:resolution","id").size();
if(allitems>0){
task.progress = openitems / allitems;
}else{
task.progress = 0;
}
task.getFields().put("progressString", openitems +" / " + allitems +" done");
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article