Skip to content

Commit

Permalink
template jira customfields
Browse files Browse the repository at this point in the history
  • Loading branch information
holger-waschke committed Sep 17, 2024
1 parent ccc1ed9 commit a55ee26
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions notify/jira/jira.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ func (n *Notifier) prepareIssueRequestBody(ctx context.Context, logger log.Logge
return issue{}, fmt.Errorf("convertToMarshalMap: %w", err)
}

for key, value := range fieldsWithStringKeys {
if strValue, ok := value.(string); ok {
processedValue, err := tmplTextFunc(strValue)
if err != nil {
return issue{}, fmt.Errorf("field %s template: %w", key, err)
}
fieldsWithStringKeys[key] = processedValue
}
}

summary, truncated := notify.TruncateInRunes(summary, maxSummaryLenRunes)
if truncated {
level.Warn(logger).Log("msg", "Truncated summary", "max_runes", maxSummaryLenRunes)
Expand Down

0 comments on commit a55ee26

Please sign in to comment.