Jira Misc Workflow Fields plugin - how to multiply?

Michel Marcoux October 31, 2012

Hi,

I've installed the 'JIRA Misc Custom Fields' plugin on my instance and trying to use the Calculated Number Field option. I've create a custom field for the result. I want that field to display the result (multiplication) of two other custom field, so I tried something like that but :

<!-- @@Formula: (issue.get("customfield_10236") != null ? issue.get("customfield_10236") : 0) * issue.get("customfield_10237") != null ? issue.get("customfield_10237") : 0) -->

but it dosen't seems to return any result... Can someone help me to acheive that or tell me what's wrong with my code, i'm a beginner :P

thanks in advance!

4 answers

0 votes
rp May 9, 2015

I think I found the answer for my question. It's answered on Sep 26, 2013 by Ozzy Ozz

0 votes
rp May 9, 2015

Hi Natalie,

Sorry to dig up long answered question.

I have installed the latest version of JIRA Misc Custom Fields Plugin for JIRA 6.2.5 Version.

I have created Calculated Number Field Type Custom Field and placed the following code in description:

<!-- @@Formula: (issue.get("customfield_123") != null ? issue.get("customfield_123") : 0) * (issue.get("customfield_234") != null ? issue.get("customfield_234") : 0) * (issue.get("customfield_345") != null ? issue.get("customfield_345") : 0) -->

Value displayed : Field is hidden for some reason.

 

When I update the either of the customfields mentioned above the calculated number field does not show up on the screen.

But when I use the below formula the calculated number field is displayed on the screen but the value is wrong

<!-- @@Formula: (issue.get("customfield_123") != null ? issue.get("customfield_123") : 0) + (issue.get("customfield_234") != null ? issue.get("customfield_234") : 0) + (issue.get("customfield_345") != null ? issue.get("customfield_345") : 0) -->

Value entered :

CF 123: 90

CF 234: 90

CF 345: 90

Value displayed : 909,090

 

Please let me know what I am doing wrong.

0 votes
KP11
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2013

One more question. Using JIRA Misc Custom Fields Is there a formula in the JIRA Calculated field that allows multipliction of 3 fields?

<!-- @@Formula: (issue.get("customfield_10236") != null ? issue.get("customfield_10236") : 0) * (issue.get("customfield_10237") != null ? issue.get("customfield_10237") : 0) -->

Can we add a third field? If so what would be the code? Thanks

Natalie Hobson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2013

Should be:

<!-- @@Formula: (issue.get("customfield_1") != null ? issue.get("customfield_1") : 0) * (issue.get("customfield_2") != null ? issue.get("customfield_2") : 0) * (issue.get("customfield_3") != null ? issue.get("customfield_3") : 0) -->

0 votes
Richard S January 18, 2013

Just casually looking at this, I can see you have 5 x ('s and 6 x )'s, therefore you have one too many (or too little) brackets in that code.

Natalie Hobson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2013

Steve is correct, here's the fixed line:

<!-- @@Formula: (issue.get("customfield_10236") != null ? issue.get("customfield_10236") : 0) * (issue.get("customfield_10237") != null ? issue.get("customfield_10237") : 0) -->

:)

Deleted user June 19, 2018

Helped me in 2018! Thanks!

Suggest an answer

Log in or Sign up to answer