Skip to content

Commit 474810a

Browse files
fix a bug how to count for existing jira issues
Signed-off-by: Holger Waschke <[email protected]>
1 parent 97bbb5a commit 474810a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

notify/jira/jira.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,13 @@ func (n *Notifier) searchExistingIssue(ctx context.Context, logger *slog.Logger,
236236
return nil, false, err
237237
}
238238

239-
if issueSearchResult.Total == 0 {
239+
issuesCount := len(issueSearchResult.Issues)
240+
if issuesCount == 0 {
240241
logger.Debug("found no existing issue")
241242
return nil, false, nil
242243
}
243244

244-
if issueSearchResult.Total > 1 {
245+
if issuesCount > 1 {
245246
logger.Warn("more than one issue matched, selecting the most recently resolved", "selected_issue", issueSearchResult.Issues[0].Key)
246247
}
247248

notify/jira/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ type issueSearch struct {
6161
}
6262

6363
type issueSearchResult struct {
64-
Total int `json:"total"`
6564
Issues []issue `json:"issues"`
6665
}
6766

0 commit comments

Comments
 (0)