Hi ,
I have an Epic & i have linked multiple existing stories in it.
I need to create a Calculated scripted field from which Estimations of all stories linked in Epic should be summed & display it.
I also have an scripted field for Stories which calculate the sum of all tasks & sub-tasks linked with the stories & provides expected result
I tried to invoke that field in this Epic Script ,to calculate & generate output but it results as 0.
Please find below Script & help me on this requirement ASAP
Script Used-->//Scripted field-->Stories linked with Epic --Original estimate Calculation
import com.atlassian.jira.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def cfManager = ComponentAccessor.getCustomFieldManager()
double totalestimate = 0
customField = cfManager.getCustomFieldObject("customfield_14126");
//customField1 =cfManager.getCustomFieldObjectsByName()
log.debug(customField)
if (issue.getIssueTypeId() != "10000") {
return null
}
issueLinkManager.getOutwardLinks(issue.id)?.each {issueLink ->;
if (issueLink.issueLinkType.name == "Epic-Story Link" ) {
def linkedIssue = issueLink.destinationObject
log.debug(linkedIssue)
double originalestimate =(double)(linkedIssue.getCustomFieldValue(customField) ?: 0)
log.debug(originalestimate)
totalestimate = originalestimate + totalestimate;
}}
Thanks in Advance
Regards,
Revathy Madhavan
Hi ,
Any update on the above request?
Regards,
Revathy Madhavan
Hi All,
Any update on the above request
Regards,
Revathy Madhavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.