It's totally possible to change the environment without destroying the host;
Foreman can take environment from hostgroup, so it's not needed to be specified. But the current code sends it in the payload as nil, which results in "error": {"id":null,"errors":{"environment_id":["can't be blank"]},"full_messages":["Environment can't be blank"]}
nil
, which results in"error": {"id":null,"errors":{"environment_id":["can't be blank"]},"full_messages":["Environment can't be blank"]}