Trying to set up a calculated value in JIRA. We have the value of ROI and PO but can't seem to define INC properly. Something like...
@Formula:
def ROI = getCustomFieldValue("customfield_10914")
def PO = getCustomFieldValue ("customfield_10913")
integer INC =
(issue.get("customfield_14008") != null ? (float) Integer.parseInt(issue.get("customfield_14008")) : 0 ) +
(issue.get("customfield_14010") != null ? (float) Integer.parseInt(issue.get("customfield_14010")) : 0 ) +
(issue.get("customfield_14011") != null ? (float) Integer.parseInt(issue.get("customfield_14011")) : 0 ) +
(issue.get("customfield_14012") != null ? (float) Integer.parseInt(issue.get("customfield_14012")) : 0 );
return ROI*INC/PO
-->
I looked around on the forums and think that I found a more accurate formula but I am sure my syntax is wrong in some way.
@Formula:
integer i =
(issue.get("customfield_14008") != null ? (float) Integer.parseInt(issue.get("customfield_14008")) : 0 ) +
(issue.get("customfield_14010") != null ? (float) Integer.parseInt(issue.get("customfield_14010")) : 0 ) +
(issue.get("customfield_14010") != null ? (float) Integer.parseInt(issue.get("customfield_14011")) : 0 ) +
(issue.get("customfield_14010") != null ? (float) Integer.parseInt(issue.get("customfield_14012")) : 0 );
(issue.get("customfield_10914") != null ? (float) Integer.parseInt(issue.get("customfield_10914")) : 0 ) *
(i != null ? (float) Integer.parseInt(i) : 0 ) /
(issue.get("customfield_10913") != null ? (float) Integer.parseInt(issue.get("customfield_10913")) : 1000000 )
-->
Any assistance would be much appreciated.