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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted 7 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

25 views 0 4
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