def METHOD_NAME(
    markup: CbcountfieldMarkupModel, task_id: str, user_id: str
) -> tuple[int, FieldValue]:
    groups = ["*"]
    if isinstance(markup.groups, list):
        groups = markup.groups
    doc_id = TaskId.parse_doc_id(task_id)
    curr_user = User.get_by_name(user_id)
    assert curr_user is not None, f"Could not find user {user_id}"
    d = DocEntry.find_by_id(doc_id)
    if not d:
        return 0, None  # TODO handle error properly
    user_fields, _, _, _ = get_fields_and_users(
        [task_id],
        RequestedGroups.from_name_list(groups),
        d,
        curr_user,
        default_view_ctx,
        access_option=GetFieldsAccess.AllowAlwaysNonTeacher,
    )
    return count_field(user_fields, task_id, curr_user)