HOWTO Calculated Number Field

Sabrina Kuehn September 8, 2013

Hi,

I try to integrade a ranking system in JIRA. I'd create 3 "radio button" custom fields (rb1, rb2 and rb3) each with 3 options 1, 2 and 3. Then I create a "Calculated Number Field" and here is my problem...

I want that this Calculated Number Field count

rb1(option number) + rb2(on) +rb3(on) - 2 = ranking

I know I have to use html but I know really nothing about html and I think I have to insert my formula in the description or not sorry for my dumb questions.

Hope you can help me.

6 answers

0 votes
Sonya S_ April 18, 2014

Hi, Can I know where to insert this formula ?

I created one custom field to summarize the number fields of customfield (11090~11094, and 11100)

Formula as below, however, the field can't display in defined screen @@

(issue.get("customfield_11090") != null ? issue.get("customfield_11090") : 0) + (issue.get("customfield_11091") != null ? issue.get("customfield_11091") : 0) + (issue.get("customfield_11092") != null ? issue.get("customfield_11092") : 0) + (issue.get("customfield_11093") != null ? issue.get("customfield_11093") : 0) + (issue.get("customfield_11094") != null ? issue.get("customfield_11094") : 0) + (issue.get("customfield_11100") != null ? issue.get("customfield_11100") : 0)

please kindly help, thank you,

0 votes
Sabrina Kuehn September 10, 2013

OK we solved the problem. The right formula is:

<!-- @@Formula:
int i = (issue.get("customfield_11188") != null ? Integer.parseInt(issue.get("customfield_11188").toString()) : 0) + (issue.get("customfield_11189") != null ? Integer.parseInt(issue.get("customfield_11189").toString()) : 0) + (issue.get("customfield_11190") != null ? Integer.parseInt(issue.get("customfield_11190").toString()) : 0) - 2;
if (i >= 1)
return i;
else
return 66;
-->

The 66 is only for a better understanding.

Thanks for you help

0 votes
Sabrina Kuehn September 8, 2013


<!-- @@Formula:

(issue.get("customfield_11188") != null ? issue.get("customfield_11188") : 0) + (issue.get("customfield_11189") != null ? issue.get("customfield_11189") : 0) + (issue.get("customfield_11190") != null ? issue.get("customfield_11190") : 0) - 2

-->

What do you think about this solution?

0 votes
Sabrina Kuehn September 8, 2013

doesn't work :-(

0 votes
Sabrina Kuehn September 8, 2013

No we (admins) select the 3 fields when someone create a ticket

Nadir MEZIANI
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.
September 8, 2013

hi,

If in screen, you can do it with javascript.

0 votes
Nadir MEZIANI
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.
September 8, 2013

Hi,

This values, user select it in the screen?

Suggest an answer

Log in or Sign up to answer