# }


# tasks/worked hours {
tasks_header = [
    'Ticket',
    'User',
    'Worked hours',
    'Created at'
]

_from = milestone.created_at
to = datetime.now()

tasks = api.tasks(
    _from=_from.strftime('%d-%m-%Y'),
    to=to.strftime('%d-%m-%Y')
)

tasks_body = []

for task in tasks:
    ticket_number = '-'
    if task.ticket_id:
        ticket_number = api.ticket(space_id=aulasdovaca.id, id=task.ticket_id).number

    tasks_body.append([
        str(ticket_number),
        api.user(id=task.user_id).name.encode('ascii', 'ignore'),
        str(task.hours),
        str(task.created_at) + '\n'
    ])