diff --git a/thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala index 35cd5d7e39..35baed7a5a 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala @@ -17,6 +17,7 @@ import org.thp.thehive.services.CaseTemplateOps._ import org.thp.thehive.services.CustomFieldOps._ import org.thp.thehive.services.ObservableOps._ import org.thp.thehive.services.OrganisationOps._ +import org.thp.thehive.services.ProcedureOps._ import org.thp.thehive.services.UserOps._ import org.thp.thehive.services._ import play.api.libs.json._ @@ -313,5 +314,6 @@ class PublicCase @Inject() ( .property("owningOrganisation", UMapping.string)( _.authSelect((cases, authContext) => cases.origin.visible(authContext).value(_.name)).readonly ) + .property("patternId", UMapping.string.sequence)(_.select(_.procedure.pattern.value(_.patternId)).readonly) .build } diff --git a/thehive/app/org/thp/thehive/controllers/v0/DescribeCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/DescribeCtrl.scala index b6d5140f80..97aec1d625 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/DescribeCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/DescribeCtrl.scala @@ -208,6 +208,8 @@ class DescribeCtrl @Inject() ( ) case ("dashboard", "status") => Some(Seq(PropertyDescription("status", "enumeration", Seq(JsString("Shared"), JsString("Private"), JsString("Deleted"))))) + case (_, "patternId") => + Some(Seq(PropertyDescription("patternId", "patternId", Nil))) case _ => None } diff --git a/thehive/app/org/thp/thehive/controllers/v1/DescribeCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/DescribeCtrl.scala index 9b2b3df80f..0643474110 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/DescribeCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/DescribeCtrl.scala @@ -185,6 +185,7 @@ class DescribeCtrl @Inject() ( case (_, "_createdBy") => Some(Seq(PropertyDescription("_createdBy", "user"))) case (_, "_updatedBy") => Some(Seq(PropertyDescription("_updatedBy", "user"))) case (_, "customFields") => Some(customFields) + case (_, "patternId") => Some(Seq(PropertyDescription("patternId", "patternId", Nil))) case _ => None } diff --git a/thehive/app/org/thp/thehive/controllers/v1/Properties.scala b/thehive/app/org/thp/thehive/controllers/v1/Properties.scala index 931676302d..819844c133 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/Properties.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/Properties.scala @@ -247,7 +247,7 @@ class Properties @Inject() ( .property("owningOrganisation", UMapping.string)( _.authSelect((cases, authContext) => cases.origin.visible(authContext).value(_.name)).readonly ) - .property("procedures", UMapping.entityId.sequence)(_.select(_.procedure.value(_._id)).readonly) + .property("patternId", UMapping.string.sequence)(_.select(_.procedure.pattern.value(_.patternId)).readonly) .build lazy val caseTemplate: PublicProperties =