It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
hi
i need to show a calculated field number field with one decimal.
float result
result = aux1 + aux2 +aux3+ aux4+ aux5;
return result:
but always shows me an integer number.
What add-ons are you using to do the scripting?
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.
<!-- @@Formula:
float result=0;
Object btn1 = issue.get("customfield_12128");
Object btn2 = issue.get("customfield_12129");
Object btn3 = issue.get("customfield_12130");
float aux1 = 0;
float aux2 = 0;
float aux3 = 0;
if( btn1 != null && btn1.toString().equals( "De 1 a 2 areas/ usuarios" ) ) { aux1 = 1/2; }
if( btn1 != null && btn1.toString().equals( "De 3 a 5 áreas /usuarios" ) ) { aux1 = 2; }
if( btn1 != null && btn1.toString().equals( "De 6 a más" ) ) { aux1 = 3; }
if( btn2 != null && btn2.toString().equals( "Interno" ) ) { aux2 = 1/2; }
if( btn2 != null && btn2.toString().equals( "Externo" ) ) { aux2 = 2; }
if( btn3 != null && btn3.toString().equals( "Política" ) ) { aux3 = 2; }
if( btn3 != null && btn3.toString().equals( "Reglamento" ) ) { aux3 = 2; }
if( btn3 != null && btn3.toString().equals( "Circular" ) ) { aux3 = 1; }
if( btn3 != null && btn3.toString().equals( "Doc. Corp. / Man. usuario / Metodologia" ) ) { aux3 = 1/2; }
result = aux1 + aux2 +aux3;
return result;
-->
help please
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I cannot properly test this at the moment but this may work. I made some changes and I added a "format" block at the end. Please try this out and report back any issues –
<!-- @@Formula: double result=0; Object btn1 = issue.get("customfield_12128"); Object btn2 = issue.get("customfield_12129"); Object btn3 = issue.get("customfield_12130"); double aux1 = 0; double aux2 = 0; double aux3 = 0; if( btn1 != null && btn1.toString().equals( "De 1 a 2 areas/ usuarios" ) ) { aux1 = 0.5; } if( btn1 != null && btn1.toString().equals( "De 3 a 5 áreas /usuarios" ) ) { aux1 = 2.0; } if( btn1 != null && btn1.toString().equals( "De 6 a más" ) ) { aux1 = 3.0; } if( btn2 != null && btn2.toString().equals( "Interno" ) ) { aux2 = 0.5; } if( btn2 != null && btn2.toString().equals( "Externo" ) ) { aux2 = 2.0; } if( btn3 != null && btn3.toString().equals( "Política" ) ) { aux3 = 2.0; } if( btn3 != null && btn3.toString().equals( "Reglamento" ) ) { aux3 = 2.0; } if( btn3 != null && btn3.toString().equals( "Circular" ) ) { aux3 = 1.0; } if( btn3 != null && btn3.toString().equals( "Doc. Corp. / Man. usuario / Metodologia" ) ) { aux3 = 0.5; } result = aux1 + aux2 +aux3; return result; --> <!-- @@Format: numberTool.format('0.0', value) -->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add-on documentation here – https://innovalog.atlassian.net/wiki/display/JMCF/JIRA+Misc+Custom+Fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<!-- @@Format: numberTool.format("0.0", value) -->
you should use the double quote marks in stead of the single ones
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Atlassian community! We're excited to share the Jira Server and Data Center 8.0 platform release. With 8.0, teams will be able to work more productively and sca...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.