Below is the script for adding two types of cost to get total cost. I want to know what is the issue with the script as no value is returned
// Required Imports
import com.atlassian.jira.component.ComponentAccessor
// Get a pointer to my Custom Field Manager
def customFieldManager = ComponentAccessor.getCustomFieldManager()
// Ensure that the script field does not store cached values and always dynamically re calculates the values every time a page is laoded.
enableCache = {-> false}
// Only execute on feature issues
if ( (issue.issueType.name == "Portfolio Epic") || (issue.issueType.name == "Portfolio Enabler")) {
// Get the required value from the cost of delay Scripted Field
def elc = getCustomFieldValue("Estimated Labor Cost") as Double;
def eoc = getCustomFieldValue("Estimated Other Cost") as Double;
if (elc > 0 && eoc >= 0) {
// Create total cost
def dbletc = elc + eoc as Double;
}
return dblelc.round();
}