Skip to content

Commit

Permalink
correct code style
Browse files Browse the repository at this point in the history
Signed-off-by: MytkoEnko <[email protected]>
  • Loading branch information
MytkoEnko committed Apr 30, 2023
1 parent 8571119 commit 54ff2a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pkg/notify/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func (r *Receiver) Notify(data *alertmanager.Data, hashJiraLabel bool, updateSum
}
}


for CustomField := range issueCustomFields {
if _, ok := issue.Fields.Unknowns[CustomField]; ok {
if issue.Fields.Unknowns[CustomField] != issueCustomFields[CustomField] {
Expand Down Expand Up @@ -315,7 +314,7 @@ func toGroupTicketLabel(groupLabels alertmanager.KV, hashJiraLabel bool) string
func (r *Receiver) search(project, issueLabel string) (*jira.Issue, bool, error) {
query := fmt.Sprintf("project=\"%s\" and labels=%q order by resolutiondate desc", project, issueLabel)
options := &jira.SearchOptions{
Fields: append([]string{"summary", "status", "resolution", "resolutiondate"}, r.conf.CustomFieldsToUpdate...),
Fields: append([]string{"summary", "status", "resolution", "resolutiondate"}, r.conf.CustomFieldsToUpdate...),
MaxResults: 2,
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/notify/notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ func testReceiverConfig2() *config.ReceiverConfig {
}
}


func testReceiverConfigAutoResolve() *config.ReceiverConfig {
reopen := config.Duration(1 * time.Hour)
autoResolve := config.AutoResolve{State: "Done"}
Expand Down Expand Up @@ -217,7 +216,7 @@ func testReceiverConfigWithCustomFields() *config.ReceiverConfig {
Fields: tcontainer.MarshalMap(map[string]interface{}{
"customfield_12345": `{{ (index .Alerts 0).Annotations.AlertValue }}`,
}),
CustomFieldsToUpdate: []string{"customfield_12345","non_existant_field"},
CustomFieldsToUpdate: []string{"customfield_12345", "non_existant_field"},
}
}

Expand Down

0 comments on commit 54ff2a7

Please sign in to comment.