Last active
July 26, 2017 12:44
-
-
Save macterra/18c9d9faa9e20cc0ec708561f68b474d to your computer and use it in GitHub Desktop.
script to generate burndown stats csv from Jira
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jira import JIRA | |
from datetime import timedelta, date | |
def daterange(startDate, endDate): | |
for n in range(int ((endDate - startDate).days)): | |
yield startDate + timedelta(n) | |
jira = JIRA('https://jira.synaptivemedical.com', basic_auth=('davidmcfadzean', '[redacted]')) | |
startDate = date(2017, 5, 1) | |
endDate = date(2017, 7, 30) | |
filter = "Drive - must fix bugs" | |
statusList = ["Open", "In Progress", "Reopened", "In Review", "Resolved", "Closed"] | |
statusString = '"Open", "In Progress", "Reopened", "In Review", "Resolved", "Closed"' | |
print "date, open, reopened, in progress, in review, resolved, closed, sum, total, changed" | |
for singleDate in daterange(startDate, endDate): | |
counts = {} | |
date = singleDate.strftime("%Y/%m/%d") | |
for status in statusList: | |
query = 'filter = "%s" AND status was in ("%s") on "%s"' % (filter, status, date) | |
bugs = jira.search_issues(query, maxResults=1000) | |
counts[status] = len(bugs) | |
query = 'filter = "%s" AND status was in (%s) on "%s"' % (filter, statusString, date) | |
bugs = jira.search_issues(query, maxResults=1000) | |
total = len(bugs) | |
sumCounts = sum(counts.values()) | |
print "%s, %d, %d, %d, %d, %d, %d, %d, %d, %d" % (date, counts['Open'], counts['Reopened'], counts['In Progress'], counts['In Review'], counts['Resolved'], counts['Closed'], sumCounts, total, sumCounts-total) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment