diff --git a/pkg/templating/template_description.go b/pkg/templating/template_description.go index 5e0491cbe..f7e2cc30c 100644 --- a/pkg/templating/template_description.go +++ b/pkg/templating/template_description.go @@ -38,13 +38,14 @@ func TemplateStringRaw(inputTemplate string, issue *v1.Issue) (*string, error) { type enrichedIssue struct { *v1.EnrichedIssue - ToolName string - ScanStartTime string - ScanID string - ConfidenceText string - SeverityText string - Count uint - FirstFound string + ToolName string + ScanStartTime string + ScanID string + ConfidenceText string + SeverityText string + Count uint + FirstFound string + FixedCodeAnnotation string } type enrichedIssueOption func(*enrichedIssue) error @@ -118,6 +119,13 @@ func EnrichedIssueWithFirstFound(firstFound time.Time) enrichedIssueOption { } } +func EnrichedIssueWithFixedCodeAnnotation(fixedCodeAnnotation string) enrichedIssueOption { + return func(ei *enrichedIssue) error { + ei.FixedCodeAnnotation = fixedCodeAnnotation + return nil + } +} + // TemplateStringEnriched applies the provided go template to the Enriched Issue provided and returns the resulting str func TemplateStringEnriched(inputTemplate string, issue *v1.EnrichedIssue, opts ...enrichedIssueOption) (*string, error) { enrichedIssue := &enrichedIssue{