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();
}
I notice a typo that may be your source of grief. You assign a value to dbletc but return dblelc.
@Payne ,
Good catch! but that didn't resolve the issue. Actually we are facing issue with other scripted fields which used to work before. I have submitted a ticket to Adaptavist and waiting for response. We updated the script runner a week before
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.