Hi @haiyaner ,
Looks similar:
In scriptrunner I use next:
import com.atlassian.jira.component.ComponentAccessor
import groovy.sql.Sql
import org.ofbiz.core.entity.ConnectionFactory
import org.ofbiz.core.entity.DelegatorInterface
import java.sql.Connection
def delegator = (DelegatorInterface) ComponentAccessor.getComponent(DelegatorInterface)
String helperName = delegator.getGroupHelperName("default");
def sqlStmt = """
SELECT * FROM jiradb.audit_log where SUMMARY='Project created';
"""
def result
Connection 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.