Fix retrieval of tickets not affecting a site

If the ticket is not assigned to a site the script trown an exception,
since there's no tag affected_site.