-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIssueRepository.go
More file actions
37 lines (32 loc) · 1008 Bytes
/
Copy pathIssueRepository.go
File metadata and controls
37 lines (32 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"database/sql"
"log"
"strconv"
)
type IssueRepository struct {
Db *sql.DB
}
func (repository *IssueRepository) getActualIssuesByStatusName(statusName *string) []Issue {
rows, err := repository.Db.Query("select id,jira_status_name,jira_key,jira_assignee_login,entity_id,jira_labels,jira_tester_login from palantir.jira_issue " +
"WHERE jira_status_name = '" + *statusName +
"'and project_key='EAISTPK' and deleted_date_time is null " +
"and jira_assignee_login is not null " +
"and jira_labels is not null " +
"order by id")
if err != nil {
log.Println(err)
}
defer rows.Close()
var issues []Issue
for rows.Next() {
issue := Issue{}
err = rows.Scan(&issue.id, &issue.statusName, &issue.key, &issue.assigneeLogin, &issue.entityId, &issue.jiraLabels, &issue.jiraTesterLogin)
if err != nil {
log.Println(err)
}
issues = append(issues, issue)
}
log.Println("received len: " + strconv.Itoa(len(issues)) + ", status: " + *statusName)
return issues
}