Please swith the conditions in orde avoid ```if not```:

```ruby
if res and res.code == 200
   # ticket created....
else
  print_error("#{peer} - Ticket not created due to error!")
  return
end
```