Sum of OriginalEstimation of Task and his subtasks estimation in ScriptedField

lukaswelte January 13, 2015

I want to create a Scripted Field that contains the Sum of the Original Estimate of the Issue + the sum of each SubTask's OriginalEstimate.

Bonus would be to have that field as a number represented as Time.

Any ideas? Help would be much appreciated!

 

1 answer

1 accepted

0 votes
Answer accepted
lukaswelte January 13, 2015

Solved it like this:

import com.atlassian.core.util.DateUtils
def result = 0
def issueEstimate = issue.originalEstimate
if (issueEstimate > 0) {
result += issueEstimate
}
issue.subTaskObjects.each { subTask ->
result += subTask.originalEstimate
}
return DateUtils.getDurationString(result)

Suggest an answer

Log in or Sign up to answer