I have write a script which executes saved procedure and gets values. The script works in console but when I placed the script into behaviours the script the script stopped working. I have a message in the logs.Could you please what the reason of this problem.
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FormField
import com.onresolve.scriptrunner.db.DatabaseUtil
import groovy.sql.Sql
import org.apache.log4j.Level
import org.apache.log4j.Logger
log = Logger.getLogger("com.acme.CreateIssue")
log.setLevel(Level.DEBUG)
FormField lotTovara = getFieldByName("Лот товара")
FormField summary = getFieldById('summary')
def rows = []
def value = DatabaseUtil.withSql('Test') {
it.callWithRows "{call ksas_exp.pr\$get_lot_photo(?,?,?)}", [lotTovara, Sql.VARCHAR, Sql.VARCHAR], {name, path ->
rows.add(name)
rows.add(path)
}
}
log.debug(rows)
def valueSummary = summary.getValue()
def valueLot = rows
summary.setFormValue(valueLot)
erorr
2020-03-05 12:22:10,477 http-nio-8080-exec-7 WARN user 742x57961x1 1ymuehn 10.7.16.80,10.9.1.65 /rest/scriptrunner/behaviours/latest/runvalidator.json [groovy.sql.Sql] Failed to execute: {call ksas_exp.pr$get_lot_photo(?,?,?)} because: Invalid column type
2020-03-05 12:22:10,478 http-nio-8080-exec-7 ERROR user 742x57961x1 1ymuehn 10.7.16.80,10.9.1.65 /rest/scriptrunner/behaviours/latest/runvalidator.json [c.o.jira.behaviours.BehaviourManagerImpl] *************************************************************************************
2020-03-05 12:22:10,480 http-nio-8080-exec-7 ERROR user 742x57961x1 1ymuehn 10.7.16.80,10.9.1.65 /rest/scriptrunner/behaviours/latest/runvalidator.json [c.o.jira.behaviours.BehaviourManagerImpl] Script function failed on issue: (create issue) project/issuetype: TEST/Test, user: user , fieldId: customfield_13001, file: <inline script>
java.sql.SQLException: Invalid column type
at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:8079)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7581)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8332)
at oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:4573)