Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/prometheus-community/jiralert
go 1.23.0

require (
github.com/andygrunwald/go-jira v1.16.0
github.com/andygrunwald/go-jira v1.16.1
github.com/go-kit/log v0.2.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.22.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/andygrunwald/go-jira v1.16.0 h1:PU7C7Fkk5L96JvPc6vDVIrd99vdPnYudHu4ju2c2ikQ=
github.com/andygrunwald/go-jira v1.16.0/go.mod h1:UQH4IBVxIYWbgagc0LF/k9FRs9xjIiQ8hIcC6HfLwFU=
github.com/andygrunwald/go-jira v1.16.1 h1:WoQEar5XoDRAibOgKzTFELlPNlKAtnfWr296R9zdFLA=
github.com/andygrunwald/go-jira v1.16.1/go.mod h1:UQH4IBVxIYWbgagc0LF/k9FRs9xjIiQ8hIcC6HfLwFU=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
Expand Down
6 changes: 3 additions & 3 deletions pkg/notify/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
// TODO(bwplotka): Consider renaming this package to ticketer.

type jiraIssueService interface {
Search(jql string, options *jira.SearchOptions) ([]jira.Issue, *jira.Response, error)
SearchV2JQL(jql string, options *jira.SearchOptionsV2) ([]jira.Issue, *jira.Response, error)
GetTransitions(id string) ([]jira.Transition, *jira.Response, error)

Create(issue *jira.Issue) (*jira.Issue, *jira.Response, error)
Expand Down Expand Up @@ -330,13 +330,13 @@ func (r *Receiver) search(projects []string, issueLabel string) (*jira.Issue, bo
// Search multiple projects in case issue was moved and further alert firings are desired in existing JIRA.
projectList := "'" + strings.Join(projects, "', '") + "'"
query := fmt.Sprintf("project in(%s) and labels=%q order by resolutiondate desc", projectList, issueLabel)
options := &jira.SearchOptions{
options := &jira.SearchOptionsV2{
Fields: []string{"summary", "priority", "status", "resolution", "resolutiondate", "description", "comment"},
MaxResults: 2,
}

level.Debug(r.logger).Log("msg", "search", "query", query, "options", fmt.Sprintf("%+v", options))
issues, resp, err := r.client.Search(query, options)
issues, resp, err := r.client.SearchV2JQL(query, options)
if err != nil {
retry, err := handleJiraErrResponse("Issue.Search", resp, err, r.logger)
return nil, retry, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/notify/notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func newTestFakeJira() *fakeJira {
}
}

func (f *fakeJira) Search(jql string, options *jira.SearchOptions) ([]jira.Issue, *jira.Response, error) {
func (f *fakeJira) SearchV2JQL(jql string, options *jira.SearchOptionsV2) ([]jira.Issue, *jira.Response, error) {
var issues []jira.Issue
for _, key := range f.keysByQuery[jql] {
issue := jira.Issue{Key: key, Fields: &jira.IssueFields{}}
Expand Down