Skip to content

Commit

Permalink
#331 Fix custom fields in merged cases
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Oct 11, 2017
1 parent c45d64c commit 9472d0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions thehive-backend/app/services/CaseMergeSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ class CaseMergeSrv @Inject() (
customFieldsObject caze.customFields().asOpt[JsObject]
} yield customFieldsObject

val mergedCustomFieldsObject: Seq[(String, JsValue)] = customFields.flatMap(_.keys).distinct.map { key
val mergedCustomFieldsObject: Seq[(String, JsValue)] = customFields.flatMap(_.keys).distinct.flatMap { key
val customFieldsValues = customFields.flatMap(cf (cf \ key).asOpt[JsObject]).distinct
if (customFieldsValues.size != 1)
key JsNull
None
else
key customFieldsValues.head
Some(key customFieldsValues.head)
}

JsObject(mergedCustomFieldsObject)
Expand Down

0 comments on commit 9472d0f

Please sign in to comment.