From 4a1999c34fa64918eff11f3e79ac285c052b8e3f Mon Sep 17 00:00:00 2001 From: Robin Riclet Date: Tue, 27 Oct 2020 13:13:05 +0100 Subject: [PATCH] #1557 PR review changes 2 --- thehive/app/org/thp/thehive/services/AlertSrv.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thehive/app/org/thp/thehive/services/AlertSrv.scala b/thehive/app/org/thp/thehive/services/AlertSrv.scala index ea3e1b41c5..0ac7644654 100644 --- a/thehive/app/org/thp/thehive/services/AlertSrv.scala +++ b/thehive/app/org/thp/thehive/services/AlertSrv.scala @@ -283,15 +283,15 @@ class AlertSrv @Inject() ( _ <- caseSrv.addTags(`case`, get(alert).tags.toSeq.map(_.toString).toSet) // No audit for markAsRead and observables // Audits for customFields, description and tags - newDescription <- Try(caseSrv.get(`case`).richCase.head.description) + c <- caseSrv.getOrFail(`case`._id) details <- Success(Json.obj( "customFields" -> get(alert).richCustomFields.toSeq.map(_.toOutput.toJson), - "description" -> newDescription, + "description" -> c.description, "tags" -> caseSrv.get(`case`).tags.toSeq.map(_.toString)) ) } yield details } (details => auditSrv.alertToCase.merge(alert, `case`, Some(details))) - .flatMap(_ => caseSrv.get(`case`).getOrFail("Case")) + .flatMap(_ => caseSrv.getOrFail(`case`._id)) } def importObservables(alert: Alert with Entity, `case`: Case with Entity)(implicit