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

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

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

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
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,716 views 17 21
Read article

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