You cannot use conditionals inside a plugin configuration. You can do
json { source => "message" }
if "thisField" in [message] {
mutate { add_field => { "MyField" => "%{[message][thisField]}" } }
} else {
mutate { add_field => { "MyField" => "empty" } }
}
Although I suspect the %{[message][thisField]} reference is wrong.