How to check multiple values using if else condition in field and create a new scripted field?

Hi, please can you tell me what does it mean this error ?

Blockquote
failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"test","node":"LHk548iBS6u1OZMSNqZDMg","reason":{"type":"aggregation_execution_exception","reason":"Unsupported script value , expected a number, date, or boolean"}}]},"status":500}