import csv


def getListOfJiraUsersFromCsv(jiraUsersToSearchFor="jira_users.csv"):
    """
    Gets list of jira users expected to find.
    The csv should contain their name in the format "FIRSTNAME LASTNAME"
    and the type "STUDENT" or "ADMIN".
    Expects first row to be a header so ignores it.
    Ignores blank lines or those starting with a #
    """
    row = 0
    users = []
    with open(jiraUsersToSearchFor) as users_csv:
        for u in users_csv:
            if row > 0:
                u = u.strip()
                if len(u) > 0 and u[0] != '#':
                    x = list(csv.reader([u], delimiter=',', quotechar='"'))[0]
                    o = {"name": x[1], "type": x[2], "year": x[0]}
                    users.append(o)
            row += 1
    return users