Hi guys,
I cannot seem to get the Custom formatting feature to work for JIRA MISC Custom Fields number field.
My code as follows is:
<!-- @@Formula:
test = (issue.get("customfield_10307") != null ? issue.get("customfield_10307") : 0 ) * (issue.get("customfield_10309") != null ? issue.get("customfield_10309") : 0 );
return "<i>"+numberTool.format(test)+"<\i>;
-->
Ideally I would like to format the calculated field as a dollar amount, ie $10.00, but I cannot even get the numberTool.format to work on a basic calculation.
I have tried these code scripts with no luck:
<!-- @@Formula:
(issue.get("customfield_10307") != null ? issue.get("customfield_10307") : 0 ) * (issue.get("customfield_10309") != null ? issue.get("customfield_10309") : 0 );
return "<i>"+numberTool.format(value)+"<\i>;
-->
I just want to multiple the two number fields and display the value as a currency. What am i missing?
Thanks
Community moderators have prevented the ability to post new answers.
As stated in https://innovalog.atlassian.net/wiki/display/JMCF/JIRA+Misc+Custom+Fields#JIRAMiscCustomFields-calculatednumberfield, the @@Formula must return a number (Integer, Double,...) which will be converted internally as a Double.
Formatting takes place in a second comment, using @@Format:
For example:
<!-- @@Formula: return (issue.get("customfield_10307") != null ? issue.get("customfield_10307") : 0 ) * (issue.get("customfield_10309") != null ? issue.get("customfield_10309") : 0 ); --> <!-- @@Format: return "<i>"+numberTool.format(value)+"</i>; -->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.