hi,
our subtasks contain a field called quantity. each issue contains 10-40 subtasks. I was wondering if jira can sum up the total of all of these subtasks and populate that total in the field we have on the parent called total quantity.
is anything like this possible?
Hello Jon,
You can perform this sum using a Scripted field provided by ScriptRunner Plugin. This would be the code:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.fields.CustomField //return number subtasks issue.getSubTaskObjects().size() CustomField total = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Total") double totalSum = 0; for(Issue subtask: issue.getSubTaskObjects()){ if(subtask.getCustomFieldValue(total) != null) totalSum += subtask.getCustomFieldValue(total) } return totalSum
For more reference, you can check the answers below:
- Sum of custom field values from subtasks in parent issue custom groovy field
- Sum of values from subtasks using JIRA Calculated Number Field
Let me know if this information helps.
Hello Jon,
For sum-up values of stories to a linked Epic, you can use the free plugin Epic Sum up - Light.
Let me know if it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.