diff --git a/pkg/jira/jira/api_test.go b/pkg/jira/jira/api_test.go index 58460a49e..cfdc187a5 100644 --- a/pkg/jira/jira/api_test.go +++ b/pkg/jira/jira/api_test.go @@ -61,7 +61,7 @@ var ( Type: jira.IssueType{ Name: "Vulnerability", }, - Description: "spotbugs detected 'Unit Test Title' at //foo1/bar1:baz2 during scan started at: 2024-10-10T20:06:33Z with id babbb83-4627-41c6-8ba0-70ee866290e9.\nConfidence: Info\nThis issue has been detected 2 times before, first found on 2024-10-10T20:06:33Z\nOriginal Description is: 'this is a test description'\nspotbugs reported severity as Info\nSmithy enrichers added the following annotations:\nfoo:bar\nfoobar:baz\n\n", + Description: "spotbugs detected 'Unit Test Title' at //foo1/bar1:baz2 during scan with id babbb83-4627-41c6-8ba0-70ee866290e9.\nConfidence: Info\nThis issue has been detected 2 times before\nOriginal Description is: 'this is a test description'\nspotbugs reported severity as Info\nSmithy enrichers added the following annotations:\nfoo:bar\nfoobar:baz\n\n", Summary: "bar1:baz2 Unit Test Title", Components: []*jira.Component{ {Name: "c1"}, diff --git a/pkg/jira/jira/apiutils.go b/pkg/jira/jira/apiutils.go index 0a89e1a8c..21dde0626 100644 --- a/pkg/jira/jira/apiutils.go +++ b/pkg/jira/jira/apiutils.go @@ -159,11 +159,9 @@ func makeDescription(draconResult document.Document, template string) string { }, }, templating.EnrichedIssueWithToolName(draconResult.ToolName), - templating.EnrichedIssueWithScanStartTime(draconResult.ScanStartTime), templating.EnrichedIssueWithScanID(draconResult.ScanID), templating.EnrichedIssueWithConfidenceText(draconResult.ConfidenceText), templating.EnrichedIssueWithCount(uint(count)), - templating.EnrichedIssueWithFirstFound(draconResult.FirstFound), templating.EnrichedIssueWithSeverityText(draconResult.SeverityText), ) if err != nil { diff --git a/pkg/jira/jira/apiutils_test.go b/pkg/jira/jira/apiutils_test.go index 8215004c9..6815bac51 100644 --- a/pkg/jira/jira/apiutils_test.go +++ b/pkg/jira/jira/apiutils_test.go @@ -61,7 +61,7 @@ func TestMakeCustomField(t *testing.T) { func TestMakeDescription(t *testing.T) { res := makeDescription(sampleResult, "") - exp := "spotbugs detected 'Unit Test Title' at //foo1/bar1:baz2 during scan started at: 2024-10-10T20:06:33Z with id babbb83-4627-41c6-8ba0-70ee866290e9.\nConfidence: Info\nThis issue has been detected 2 times before, first found on 2024-10-10T20:06:33Z\nOriginal Description is: 'this is a test description'\nspotbugs reported severity as Info\nSmithy enrichers added the following annotations:\nfoo:bar\nfoobar:baz\n\n" + exp := "spotbugs detected 'Unit Test Title' at //foo1/bar1:baz2 during scan with id babbb83-4627-41c6-8ba0-70ee866290e9.\nConfidence: Info\nThis issue has been detected 2 times before\nOriginal Description is: 'this is a test description'\nspotbugs reported severity as Info\nSmithy enrichers added the following annotations:\nfoo:bar\nfoobar:baz\n\n" require.Equal(t, res, exp) } diff --git a/pkg/jira/jira/issueTemplate.txt b/pkg/jira/jira/issueTemplate.txt index b404e89cc..09381f9ef 100644 --- a/pkg/jira/jira/issueTemplate.txt +++ b/pkg/jira/jira/issueTemplate.txt @@ -1,6 +1,6 @@ -{{.ToolName}} detected '{{.RawIssue.Title}}' at {{.RawIssue.Target}} during scan started at: {{.ScanStartTime}} with id {{.ScanID}}. +{{.ToolName}} detected '{{.RawIssue.Title}}' at {{.RawIssue.Target}} during scan with id {{.ScanID}}. Confidence: {{.ConfidenceText}} -{{ if gt .Count 0 }}This issue has been detected {{.Count}} times before, first found on {{.FirstFound}}{{ end }} +{{ if gt .Count 0 }}This issue has been detected {{.Count}} times before{{ end }} Original Description is: '{{.RawIssue.Description}}' {{.ToolName}} reported severity as {{.SeverityText}} Smithy enrichers added the following annotations: