Skip to content

Commit

Permalink
[api] Change default value of media content
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Oct 1, 2022
1 parent d0fc3f5 commit b02996d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions opencti-platform/opencti-graphql/src/utils/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const observableValue = (stixCyberObservable) => {
case ENTITY_WINDOWS_REGISTRY_VALUE_TYPE:
return stixCyberObservable.name || stixCyberObservable.data || 'Unknown';
case ENTITY_MEDIA_CONTENT:
return stixCyberObservable.url || stixCyberObservable.title || 'Unknown';
return stixCyberObservable.content || stixCyberObservable.title || stixCyberObservable.url || 'Unknown';
default:
return stixCyberObservable.value || stixCyberObservable.name || 'Unknown';
}
Expand Down Expand Up @@ -228,7 +228,11 @@ export const runtimeFieldObservableValueScript = () => {
emit('Unknown')
}
} else if (type == 'media-content') {
if (have(doc, 'url')) {
if (have(doc, 'content')) {
emit(doc['content.keyword'].value)
} else if (have(doc, 'title')) {
emit(doc['title.keyword'].value)
} else if (have(doc, 'url')) {
emit(doc['url.keyword'].value)
} else {
emit('Unknown')
Expand Down

0 comments on commit b02996d

Please sign in to comment.