コード例 #1
0
    if len(sys.argv) != 5:
        sys.stderr.write(
            "Usage: %s user_mappings.tsv src_jira_url dest_jira_url file.json > out.json\n"
            % sys.argv[0])
        sys.stderr.write(
            "Example: %s user_mappings.tsv https://issues.cloudera.org https://issues.apache.org/jira file.json > out.json\n"
            % sys.argv[0])
        sys.exit(1)

    user_mappings_filename = sys.argv[1]
    src_jira_url = sys.argv[2]
    dest_jira_url = sys.argv[3]
    filename = sys.argv[4]

    # Read the username mappings.
    user_map = get_user_mappings(user_mappings_filename)

    # Fetch the global list of fields from the server.
    field_map = get_field_map(src_jira_url)

    with open(filename, "r") as f:
        data = json.load(f)
        for proj in data["projects"]:
            project_key = None
            release_version_map = None
            for issue in proj["issues"]:
                if project_key is None:
                    project_key, _ = issue["key"].split("-", 2)
                    release_version_map = get_version_map(
                        src_jira_url, dest_jira_url, project_key)
コード例 #2
0
            issue["customFieldValues"].append(custom_field_out)

if __name__ == "__main__":

    if len(sys.argv) != 5:
        sys.stderr.write("Usage: %s user_mappings.tsv src_jira_url dest_jira_url file.json > out.json\n" % sys.argv[0])
        sys.stderr.write("Example: %s user_mappings.tsv https://issues.cloudera.org https://issues.apache.org/jira file.json > out.json\n" % sys.argv[0])
        sys.exit(1)

    user_mappings_filename = sys.argv[1]
    src_jira_url = sys.argv[2]
    dest_jira_url = sys.argv[3]
    filename = sys.argv[4]

    # Read the username mappings.
    user_map = get_user_mappings(user_mappings_filename)

    # Fetch the global list of fields from the server.
    field_map = get_field_map(src_jira_url)

    with open(filename, "r") as f:
        data = json.load(f)
        for proj in data["projects"]:
            project_key = None
            release_version_map = None
            for issue in proj["issues"]:
                if project_key is None:
                    project_key, _ = issue["key"].split("-", 2)
                    release_version_map = get_version_map(src_jira_url, dest_jira_url, project_key)

                sys.stderr.write("INFO: Processing %s...\n" % (issue["key"],))