Project Tasks - How to make the roll-up field true?

troy_jensen
Kilo Contributor

Hello,

We want the task number of project tasks that have child tasks to be shaded green to indicate they have child tasks. The setting to make that happen is if rollup == true. The rollup field is being left as false (unchecked) when we create a child task. Would it be a business rule that needs to be tweaked or created or could it be a UI Policy on the project task form? Any insights will be appreciated. Thanks.

Troy

3 REPLIES 3

Michael Kaufman
Giga Guru

There is a business rule, called "Update parent rollup field". This should set your "rollup" checkbox. If your "parent" field isn't being set right, then this might not work.

I would look into that business rule and the parent field.

Mike


jussi_vuokko
Tera Contributor

Update the setRollup() function with the following and it should work as expected:

function setRollup(task) {
var gr = new GlideRecord("planned_task");
gr.addQuery("parent", task.getUniqueValue());
gr.setLimit(1); //only need one to know
gr.query();
var hasChildren = false;
if (gr.hasNext())
var hasChildren = true;

if (task.rollup != hasChildren) {
var gr2 = new GlideRecord("planned_task");
gr2.addQuery("sys_id", task.sys_id);
gr2.query();
if(gr2.next()) {
gr2.rollup = hasChildren;
gr2.setWorkflow(false);
gr2.update();
}
}
}

BR, Jussi


I know there was a reported bug around rollup field at one point. Check with support to see if there's a patch for the version you are running.