calculated select field value from "Jira Misc Custom Fields"

Hi,

I try to calculate select field value (number value) i used "jira misc custom field plugin - Calculated Number Field custom field" as their said i got 2 custom field

" customfield_24499 and customfield_24497" and i use this formula

"<!-- @@Formula: (issue.get("customfield_24497") != null ? issue.get("customfield_24497") : 0)

+ (issue.get("customfield_24499") != null ? issue.get("customfield_24499") : 0) -->"

it works but for example i select value "4" from custom field 1 and select value "1" from custom field 2 it calculated = 41 as see it doesnt work and it calculate merge value.

how can i do ?

p.s : sorry for grammer

2 answers

1 accepted

hi michal,

i solved problem. both custom field are "select list". it assigned number value both custom field

i used this formula at customfield

"<!-- @@Formula: (Integer.parseInt(issue.get("customfield_24497")) != null ? Integer.parseInt(issue.get("customfield_24497")) : 0)
+ (Integer.parseInt(issue.get("customfield_24499")) != null ? Integer.parseInt(issue.get("customfield_24499")) : 0)-->"

if i dont use "Integer.parseInt" at formula it cannot calculate number value it concatenated value.

congratulations! :)

I would appriciate it if you vote up my answer or accept it. Thanks.

does the 2 custom fields return strings or numbers? If it is string it is pretty obvious that you get the values concatenated.

The solution is eighter to return number values from the fields or parse the strings into numbers and then add them.

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,864 views 12 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