def ticket_assigned_body(payload: Dict[(str, Any)]) -> Optional[str]:
    state = payload['state']
    kwargs = {'state': ('open' if (state == 'opened') else state), 'number': payload['number'], 'title': payload['title'], 'app_url': payload['app_url']}
    assignee = payload['assignee']
    assigned_group = payload['assigned_group']
    if (assignee or assigned_group):
        if (assignee and assigned_group):
            kwargs['assignee_info'] = '{assignee} from {assigned_group}'.format(**payload)
        elif assignee:
            kwargs['assignee_info'] = '{assignee}'.format(**payload)
        elif assigned_group:
            kwargs['assignee_info'] = '{assigned_group}'.format(**payload)
        return TICKET_ASSIGNED_TEMPLATE.format(**kwargs)
    else:
        return None
def ticket_assigned_body(payload: Dict[(str, Any)]) -> Optional[str]:
    state = payload['state']
    kwargs = {'state': ('open' if (state == 'opened') else state), 'number': payload['number'], 'title': payload['title'], 'app_url': payload['app_url']}
    assignee = payload['assignee']
    assigned_group = payload['assigned_group']
    if (assignee or assigned_group):
        if (assignee and assigned_group):
            kwargs['assignee_info'] = '{assignee} from {assigned_group}'.format(**payload)
        elif assignee:
            kwargs['assignee_info'] = '{assignee}'.format(**payload)
        elif assigned_group:
            kwargs['assignee_info'] = '{assigned_group}'.format(**payload)
        return TICKET_ASSIGNED_TEMPLATE.format(**kwargs)
    else:
        return None