how to automatically calculate a sum based on 2 custom fields ?

Jira Beginner October 16, 2015

Hi,

I created a field "Total" and in the description, I wrote the following formula in the description :

This field is a calculation of IT Cost Estimation (MD)(customfield_10311) + OPS Cost Estimation (MD) (customfield_10176) <!-- @@Formula: if ((issue.get("customfield_10311") != null) && (issue.get("customfield_10176") != null)){

var IT Cost Estimation (MD)= 0; var OPS Cost Estimation (MD)= 0;

return (IT Cost Estimation (MD)* OPS Cost Estimation (MD)); } -->

both custom field are numerical fields.

but it does not work. Any ideas?

Thanks a lot for any help

2 answers

1 vote
Gautam October 16, 2015
Do you want to create a sum or multiply them? I think the following code should work:
<!-- @@Formula: return ((issue.get("customfield_10311") != null ? issue.get("customfield_10311") : 0) + (issue.get("customfield_10176") != null ? issue.get("customfield_10176") : 0))-->
0 votes
Jira Beginner October 18, 2015

thanks a lot for your answer. I'll try it as soon as I can as I have a bug with my custom fields. I can't see the entire list anymore...

Suggest an answer

Log in or Sign up to answer