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>":"");
};

- 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");