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

This widget could not be displayed.
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))-->
This widget could not be displayed.

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
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

266 views 1 3
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