2 #/******************************************************************************
4 # * Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org) *
6 # * This program is free software; you can redistribute it and/or *
7 # * modify it under the terms of the GNU General Public License *
8 # * as published by the Free Software Foundation; either version 2 *
9 # * of the License, or (at your option) any later version. *
11 # * This program is distributed in the hope that it will be useful, *
12 # * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 # * GNU General Public License for more details. *
16 # * You should have received a copy of the GNU General Public License *
17 # * along with this program; if not, write to the Free Software Foundation *
18 # * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
19 # ******************************************************************************/
21 import urllib2, json, sys
24 print "Usage:", sys.argv[0], "<VERSION>"
27 version_name = sys.argv[1]
29 rsp = urllib2.urlopen("https://dev.icinga.org/projects/i2/versions.json")
30 versions_data = json.loads(rsp.read())
34 for version in versions_data["versions"]:
35 if version["name"] == version_name:
36 version_id = version["id"]
39 if version_id == None:
40 print "Version '%s' not found." % (version_name)
45 for field in version["custom_fields"]:
47 changes = field["value"]
50 print "### What's New in Version %s" % (version_name)
64 # We could filter using &cf_13=1, however this doesn't currently work because the custom field isn't set
65 # for some of the older tickets:
66 rsp = urllib2.urlopen("https://dev.icinga.org/projects/i2/issues.json?offset=%d&status_id=closed&fixed_version_id=%d" % (offset, version_id))
67 issues_data = json.loads(rsp.read())
68 issues_count = len(issues_data["issues"])
69 offset = offset + issues_count
74 for issue in issues_data["issues"]:
77 for field in issue["custom_fields"]:
78 if field["id"] == 13 and "value" in field and field["value"] == "0":
85 log_entries.append((issue["tracker"]["name"], issue["id"], issue["subject"]))
90 for log_entry in sorted(log_entries):
91 if (p == 0 and log_entry[0] == "Feature") or (p == 1 and log_entry[0] != "Feature"):
92 print "* %s %d: %s" % log_entry