From 1e23eb024e3ee06625032606f30521243efb8968 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 27 Aug 2015 14:45:41 -0600 Subject: [PATCH] Add ability to get jira tickets without estimate --- bin/jira-summary | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/jira-summary b/bin/jira-summary index d912e62..53c757e 100755 --- a/bin/jira-summary +++ b/bin/jira-summary @@ -13,16 +13,26 @@ def _get_without_epic(created): without_epic = [issue for issue in created['issues'] if issue['fields']['customfield_10008'] is None] return without_epic +def _get_without_estimate(created): + def _has_estimate(issue): + return any([issue['fields']['aggregatetimeestimate'], + issue['fields']['aggregatetimeoriginalestimate']]) + + without_estimate = [issue for issue in created['issues'] if not _has_estimate(issue)] + return without_estimate + def _show_summary(session, timepoint): start, end = teamanalysis.time.get_checkpoint(timepoint) created = teamanalysis.jira.issues_created_between(session, start, end) without_epic = _get_without_epic(created) + without_estimate = _get_without_estimate(created) resolved = teamanalysis.jira.issues_resolved_between(session, start, end) print("\t".join([ start.date().isoformat(), end.date().isoformat(), str(created['total']), str(resolved['total']), + str(len(without_estimate)), str(len(without_epic)), ])) @@ -33,9 +43,9 @@ def main(): config = teamanalysis.config.get() - timepoint = datetime.datetime(2015, 5, 1, 0, 0, 1) + timepoint = datetime.datetime(2015, 8, 1, 0, 0, 1) session = teamanalysis.jira.create_session(**config['jira']) - print("Start Date\tEnd Date\tCreated\tCompleted\tWithout epic") + print("Start Date\tEnd Date\tCreated\tCompl\tNo est\tNo epic") now = datetime.datetime.utcnow() while timepoint < now + datetime.timedelta(days=7): _show_summary(session, timepoint)