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


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 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,866 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