Hi
I have a project plan like this picture. I'm going to calculate progress based on the custom Business Value field. Business Value enters for the epic issue type in my plan on different levels, and I create this hierarchy based on the ParentChild issue link type.
I create 3 number custom field Type:
1- EBV(Estimated Business Value)(Likewise Original Estimate)
2- BBV(Burned Business Value)(Likewise Time Spent)
3- RBV(Remaining Business Value)(Likewise Remaining Estimate)
Progress Calculation for epics equal to 0 or 100 (Definition of Done), and I'll fill RBV the same as EBV when creating an issue(IP-5 issue in the screenshot) and consider 0 for BBV default value. When epic transfer to done status, I transfer EBV value to BBV and change it's value to 0 (IP-6 issue in the screenshot).

What I want is a scripted progress field to calculate BBV/EBV for the IP-2 issue which it means: (15+5+5)/(15+5+5+5)=0.83
I write this script thanks to Adaptivist Library, But it just looks for one level of ParentChild relation between issues. I get 10 for EBV and 5 for BBV, which means it didn't get IP-7 and IP-8 values for this calculation.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
// the linked issues with that issue type will used
final String linkedIssueType = "Epic"
final String issueLinkTypeName = "ParentChild"
// the values of that custom field - of type number - we want to sum up
final String BurnedValue = "BBV"
final String EstimatedValue = "EBV"
def linkedIssues = ComponentAccessor.issueLinkManager.getOutwardLinks(issue.id).findAll { it.destinationObject.issueType.name == linkedIssueType }
if (!linkedIssues) {
return null
}
def mycustomField = ComponentAccessor.customFieldManager.getCustomFieldObjects(linkedIssues.first().destinationObject).findByName(BurnedValue)
def myBurnedValue = ComponentAccessor.customFieldManager.getCustomFieldObjects(linkedIssues.first().destinationObject).findByName(BurnedValue)
def myEstimatedValue = ComponentAccessor.customFieldManager.getCustomFieldObjects(linkedIssues.first().destinationObject).findByName(EstimatedValue)
if (!myBurnedValue || !myEstimatedValue) {
log.debug "Custom fields are not configured for that context"
return null
}
def bbv = linkedIssues*.destinationObject.sum { Issue it -> it.getCustomFieldValue(myBurnedValue) ?: 0 }
def ebv = linkedIssues*.destinationObject.sum { Issue it -> it.getCustomFieldValue(myEstimatedValue) ?: 0 }
Any help in these scenarios will be appreciated:
1- Calculate this number fields based on the values of their children by ParentChild link
2- New scripted field that gets all these numbers at all levels and calculates progress based on them.
I know Bigpicture has some similar features that I want. Still, Unfortunately, It considers the values of this filed at last level of hierarchies, and If I break down epics to stories and subtasks, I have to enter 0 for these fields in all those issues that are very time-consuming. I think it's not a conventional method.
