Workflow rule to set parent task Estimation based on subtasks' estimation

  • 6
  • 60

The following rule is not working:

when subtask of.isNotEmpty && subtask of.first.Estimation == null && Estimation.changed {
var parent = subtask of.first;
parent.Estimation = parent.Estimation + Estimation;
}

Error: "Estimation:period is not subtype of instant or string."
Question is not answered.
Hi Diaego,

it's the know bug and it hasn't fixed yet - http://youtrack.jetbrains.com/issue/JT-18128 - please vote/comment it.

You can change type of Estimation fieled to integer as well
(or use a custom filed of type integer).

Then there is no problem with adding these and the rule will look like
(I added type Story as we use the scrum here):

rule Set Story Estimation (in hours) when subtask Estimation changes

when issue.Estimation.changed {
if (issue.subtask of.isNotEmpty) {
for each parent in issue.subtask of {
var newEstimation = 0;
for each child in parent.parent for {
newEstimation = newEstimation + child.Estimation;
}
if (parent.Estimation != newEstimation) {
parent.Estimation = newEstimation;
}
}
}
}

Hi,

I tried converting the Estimation field to integer from period, but I was unable to do so because:
'Can't change type for prototype, as it is used in time tracking.'

I already tried disabling time tracking for the project. I also tried creating another field of type int, but I don't know how to cast period to integer to migrate the current estimations.

Is there a workaround for this? The end goal for this is to know how much work is left in a story.

Thanks.

Hello, Alexandru!
To convert Estimation to int you should go to project, where it is set up as Estimation field for Time Tracking and select "No estimation field" in corresponding dropdown.

Hi Anna,

Thanks for your answer! I thought I disabled Time Tracking completely for that project.
I will get back on this issue when I get some time to revisit it.

Cheers,
Alex