Jira Misc Workflow Fields plugin - how to multiply?

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

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.

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) -->

:)

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

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) -->

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.

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

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,801 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot