Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sum of OriginalEstimation of Task and his subtasks estimation in ScriptedField

lukaswelte
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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