Hi @haiyaner ,
Looks similar:
https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Groovy-script-accessing-MySQL-database-works-in-Script-Runner/qaq-p/364831
In scriptrunner I use next:
import com.atlassian.jira.component.ComponentAccessorimport groovy.sql.Sqlimport org.ofbiz.core.entity.ConnectionFactoryimport org.ofbiz.core.entity.DelegatorInterfaceimport java.sql.Connectiondef delegator = (DelegatorInterface) ComponentAccessor.getComponent(DelegatorInterface)String helperName = delegator.getGroupHelperName("default");def sqlStmt = """SELECT * FROM jiradb.audit_log where SUMMARY='Project created';"""def resultConnection conn = ConnectionFactory.getConnection(helperName);Sql sql = new Sql(conn)try {StringBuffer sb = new StringBuffer()sql.eachRow(sqlStmt) {sb << "${it.created} | ${it.author_key} | ${it.object_name}; \n"}result = sb.toString()//log.error sb.toString()}finally {sql.close()}return result
B.R.
hi,I have a link to the MySql database at scriptrunner,But I want to link the MySql database in the JMWE plug-in,And then there's the problem in the figure above
It looks like you're new here. Sign in or register to get started.