Advertisement
Guest User

Untitled

a guest
Sep 17th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.83 KB | None | 0 0
  1. import groovy.sql.Sql;
  2. import java.sql.Driver;
  3.  
  4. def driver = Class.forName('org.postgresql.Driver').newInstance() as Driver;
  5. def props = new Properties();
  6.     props.setProperty("user", "jira_ssc-vrn");
  7.     props.setProperty("password", "Zp82qNLfAr45");
  8. def conn = driver.connect("jdbc:postgresql://localhost:5432/jira_ssc-vrn", props);
  9. def sql = new Sql(conn);
  10. try{
  11.    sql.rows("""
  12.        SELECT "ISSUEID", "SLACUSTOMFIELDID", issuenum, summary FROM "AO_4AED16_TSLAISSUEATTRS", jiraissue
  13.        where jiraissue.id = "ISSUEID" group by "ISSUEID", "SLACUSTOMFIELDID", issuenum, summary having count(*) > 1 order by "ISSUEID" desc;
  14.    """)
  15.     //sql.rows("SELECT \"TIMESPENT\" FROM \"AO_4AED16_TSLAISSUEATTRS\" where \"ISSUEID\"='193412' and \"SLACUSTOMFIELDID\"=\'customfield_10557\'");
  16. }finally{
  17.     sql.close()
  18.     conn.close()
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement