I am using Event based action
i want to multiply two value for example
issue.get("A") * issue.get("B")
I need to multiply the value in A and B
Both are an Select List (single choice)
This is my input in groovy
issue.get("A") * issue.get("B")
I am getting the error below:
groovy.lang.MissingMethodException: No signature of method: java.lang.String.multiply() is applicable for argument types: (String) values: [2] Possible solutions: multiply(java.lang.Number)
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70) org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115) org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127) script_26368e98e66f945a82190506d60ca4bc.run(script_26368e98e66f945a82190506d60ca4bc.groovy:1)
Hi @Abdullah Sa'D Muhammad Answar Vencapah ,
issue.get applied to a Single-select field returns a String, not a number. You need to convert the string to a number first:
Integer.parseInt(issue.get("A","0")) * Integer.parseInt(issue.get("B","0"))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.