diff --git a/go.mod b/go.mod index f8ac019fa3..33897a95f7 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.24.1 require ( github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible - github.com/andygrunwald/go-jira v1.16.0 + github.com/andygrunwald/go-jira v1.16.1 github.com/antchfx/htmlquery v1.3.4 github.com/bluele/gcache v0.0.2 github.com/go-playground/validator/v10 v10.26.0 diff --git a/go.sum b/go.sum index ae2cdea3db..0312072803 100644 --- a/go.sum +++ b/go.sum @@ -383,8 +383,8 @@ github.com/andybalholm/brotli v1.1.2-0.20250424173009-453214e765f3 h1:8PmGpDEZl9 github.com/andybalholm/brotli v1.1.2-0.20250424173009-453214e765f3/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= -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/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antchfx/htmlquery v1.3.4 h1:Isd0srPkni2iNTWCwVj/72t7uCphFeor5Q8nCzj1jdQ= diff --git a/pkg/reporting/trackers/jira/jira.go b/pkg/reporting/trackers/jira/jira.go index bfb518daa7..438261acaa 100644 --- a/pkg/reporting/trackers/jira/jira.go +++ b/pkg/reporting/trackers/jira/jira.go @@ -330,11 +330,12 @@ func (i *Integration) FindExistingIssue(event *output.ResultEvent, useStatus boo jql = fmt.Sprintf("%s AND status != \"%s\"", jql, i.options.StatusNot) } - searchOptions := &jira.SearchOptions{ + searchOptions := &jira.SearchOptionsV2{ MaxResults: 1, // if any issue exists, then we won't create a new one + Fields: []string{"summary", "description", "issuetype", "status", "priority", "project"}, } - chunk, resp, err := i.jira.Issue.Search(jql, searchOptions) + issues, resp, err := i.jira.Issue.SearchV2JQL(jql, searchOptions) if err != nil { var data string if resp != nil && resp.Body != nil { @@ -348,10 +349,10 @@ func (i *Integration) FindExistingIssue(event *output.ResultEvent, useStatus boo case 0: return jira.Issue{}, nil case 1: - return chunk[0], nil + return issues[0], nil default: - gologger.Warning().Msgf("Discovered multiple opened issues %s for the host %s: The issue [%s] will be updated.", template, event.Host, chunk[0].ID) - return chunk[0], nil + gologger.Warning().Msgf("Discovered multiple opened issues %s for the host %s: The issue [%s] will be updated.", template, event.Host, issues[0].ID) + return issues[0], nil } }