Hi,
I have the below scripted field to sum up estimates. It works fine mostly until one of the estimates contain a '0' at which point the script fails to display anything.
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.fields.CustomField
CustomFieldManager cfManager = componentManager.getCustomFieldManager()
def product_mangament_estimate cfManager.getCustomFieldObject(27922)?.getValue(issue);
def estimate_1 = cfManager.getCustomFieldObject(13524)?.getValue(issue);
def estimate_2 = cfManager.getCustomFieldObject(19222)?.getValue(issue);
def estimate_3 = cfManager.getCustomFieldObject(34032)?.getValue(issue);
def estimate_4 = cfManager.getCustomFieldObject(34033)?.getValue(issue);
if ( (estimate_1) && (estimate_2) && (estimate_3) && (estimate_4) && (estimate_5))
return ((estimate_1 + estimate_2 + estimate_3 + estimate_4 + estimate_5)).round(0)
else {
return null
}Any ideas?
Thanks,
Gaj