Created
May 12, 2021 09:37
-
-
Save vikrantyadav11/6148856ed065687e89f5c65adc9e860d to your computer and use it in GitHub Desktop.
Run SQL query in script console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.atlassian.jira.component.ComponentAccessor | |
| import com.onresolve.scriptrunner.db.DatabaseUtil | |
| import groovy.sql.Sql | |
| import org.ofbiz.core.entity.ConnectionFactory | |
| import org.ofbiz.core.entity.DelegatorInterface | |
| def issueManager = ComponentAccessor.issueManager | |
| def output = [] | |
| def result = [:] | |
| DatabaseUtil.withSql('local_db') { sql -> | |
| output = sql.rows("""select cfname from customfield where customfieldtypekey = 'com.atlassian.jira.plugin.system.customfieldtypes:select'""") | |
| } | |
| log.warn "${output.size()}" | |
| log.warn "${output.asList()}" | |
| output.each { | |
| result = it as Map<String,String> | |
| } | |
| result.each { | |
| log.warn it | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment