From de897784ec901dd1adb237a43b13c6e04627b24d Mon Sep 17 00:00:00 2001 From: Ramanan Ravikumar <38394463+ramanan-ravi@users.noreply.github.com> Date: Fri, 25 Oct 2024 22:02:52 +0530 Subject: [PATCH] Jira - fix attachment empty when optional custom fields are not set (#2354) (cherry picked from commit 5bc0d34f65e34832f10aca3b5c22d9fa5e2a27b8) --- deepfence_server/pkg/integration/jira/jira.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deepfence_server/pkg/integration/jira/jira.go b/deepfence_server/pkg/integration/jira/jira.go index 1f4cb4c6f1..390bb056c5 100644 --- a/deepfence_server/pkg/integration/jira/jira.go +++ b/deepfence_server/pkg/integration/jira/jira.go @@ -117,6 +117,15 @@ func (j Jira) SendNotification(ctx context.Context, message []map[string]interfa return err } + payload = string(finalByte) + } else { + finalByte, err := json.MarshalIndent(message, "", " ") + if err != nil { + log.Error().Msgf(err.Error()) + span.EndWithErr(err) + return err + } + payload = string(finalByte) }