def get_jira_release_id(rel_name, jira, proj):
    """Return the ID of the release in a given project."""
    versions = jira.project_versions(proj)
    for version in reversed(versions):
        if version.name == rel_name:
            return version.id

    raise Exception("Failed to get version id for release %s" % rel_name)