I have a project I use to track my vehicle maintenance and fuel logs. I'm trying to automate my fuel milage "MPG".
I have 3 custom numeric fields:
issue.customfield_10216 = Current Mileage ie 31,796 miles
issue.customfield_10215 = Previous Mileage ie 31,271 miles
issue.customfield_10213 = Gallons 33.5 gallons of fuel
In something like excel, I'd have a formula: (issue.customfield_10216-issue.customfield_10215)/issue.customfield_10213
which would result in 15.7 MPG.
Looking at documentation, I'm able to get the first part to work by subtracting issue.customfield_10215 from issue.customfield_10216 resulting in 525, but when I try to divide that by issue.customfield_10213 it just sets the field to 525, instead of doing the division, almost like it's ignoring the rest of my formula.
Here's my formula: {{issue.customfield_10216.minus(issue.customfield_10215).divide(issue.customfield_10213)}}
I tried wrapping the first part in () like this, but that just ended up in error:
{{(issue.customfield_10216.minus(issue.customfield_10215)).divide(issue.customfield_10213)}}
Any suggestions on how to write this properly?