Skip to content

Commit 328991e

Browse files
committed
fix_jira: - update go-jira to resolve deprecated endpoint
1 parent 0426fd3 commit 328991e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/prometheus-community/jiralert
33
go 1.23.0
44

55
require (
6-
github.com/andygrunwald/go-jira v1.16.0
6+
github.com/andygrunwald/go-jira v1.16.1
77
github.com/go-kit/log v0.2.1
88
github.com/pkg/errors v0.9.1
99
github.com/prometheus/client_golang v1.22.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/andygrunwald/go-jira v1.16.0 h1:PU7C7Fkk5L96JvPc6vDVIrd99vdPnYudHu4ju2c2ikQ=
2-
github.com/andygrunwald/go-jira v1.16.0/go.mod h1:UQH4IBVxIYWbgagc0LF/k9FRs9xjIiQ8hIcC6HfLwFU=
1+
github.com/andygrunwald/go-jira v1.16.1 h1:WoQEar5XoDRAibOgKzTFELlPNlKAtnfWr296R9zdFLA=
2+
github.com/andygrunwald/go-jira v1.16.1/go.mod h1:UQH4IBVxIYWbgagc0LF/k9FRs9xjIiQ8hIcC6HfLwFU=
33
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
44
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
55
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=

pkg/notify/notify.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
// TODO(bwplotka): Consider renaming this package to ticketer.
3636

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

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

338338
level.Debug(r.logger).Log("msg", "search", "query", query, "options", fmt.Sprintf("%+v", options))
339-
issues, resp, err := r.client.Search(query, options)
339+
issues, resp, err := r.client.SearchV2JQL(query, options)
340340
if err != nil {
341341
retry, err := handleJiraErrResponse("Issue.Search", resp, err, r.logger)
342342
return nil, retry, err

pkg/notify/notify_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func newTestFakeJira() *fakeJira {
5252
}
5353
}
5454

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

0 commit comments

Comments
 (0)