def get_task_from_request_form(request):
    """
    Parses a request from the API endpoint attempting to extract the JSON information and transform
    it on a python dict

    Returns
    -------
    dict
        a dictionary obtained from the provided json

    Raises
    ------
    ValueError
        If a required field is missing
    """
    json_data = request.get_json()
    # Required fields
    if "title" not in json_data:
        raise ValueError("Required field is missing")
    if "reference" not in json_data:
        raise ValueError("Required field is missing")
    if "status" not in json_data:
        raise ValueError("Required field is missing")

    task_from_request = {
        'title': json_data['title'],
        'reference': json_data['reference'],
        'description': json_data['description'],
        'timeWorked': [],
        'status': json_data['status'],
        'visible': "visible" in json_data
    }

    return task_from_request