jman1205 jman1205 - 2 months ago 20
Groovy Question

JIRA ScriptRunner Multiplying 2 CustomFieldValues error

I am trying to multiply two CustomFieldValues but end up with the following errors:

error

Here is the code:

Code

What can be done to resolve the errors?

Edit1:
I changed my totalInstanceCost calculation to:
parsing

but still receive the errors:

error2

Answer

Change

totalInstanceCost = instanceString * usageString * 31

to

totalInstanceCost = Double.parseDouble(instanceString.toString()) * 
                    Double.parseDouble(usageString.toString()) * 31
Comments