import requests


def get_field_map(src_jira_url):
    """ Return map of available JIRA fields, keyed by field id. """
    field_api_path = "/rest/api/2/field"
    field_name_map = {}
    url = src_jira_url + field_api_path
    r = requests.get(url);
    fields = r.json()
    for field in fields:
        if "id" in field:
            field_name_map[field["id"]] = field
    return field_name_map