From 136af04dfe39d7bafae9fc522d56423b938579bc Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 5 Sep 2013 00:02:35 +0200 Subject: Attach labels at creation time -> speedup --- issues.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/issues.py b/issues.py index 1a6ff68..db7623d 100755 --- a/issues.py +++ b/issues.py @@ -170,7 +170,7 @@ def handle_tracker_item(item, issue_title_prefix, statusprintprefix): ])) print statusprintprefix+ 'Creating: %s [%s] (%d comments)%s for SF #%s from %s' % (title, ','.join(labels), len(comments), ' (closed)' if closed else '', item_id, item_date) - response = rest_call('POST', 'issues', {'title': title, 'body': body}) + response = rest_call('POST', 'issues', {'title': title, 'body': body, 'labels': labels}) if response.status_code == 500: print "ISSUE CAUSED SERVER SIDE ERROR AND WAS NOT SAVED!!! Import will continue." else: @@ -178,8 +178,6 @@ def handle_tracker_item(item, issue_title_prefix, statusprintprefix): if 'number' not in issue: raise RuntimeError("No 'number' in issue; response %d invalid" % response.status_code) number = issue['number'] - print statusprintprefix + 'Attaching labels: %s' % labels - rest_call('POST', 'issues/%s/labels' % (number), labels) for comment in comments: print statusprintprefix + 'Creating comment: %s' % comment[:50].replace('\n', ' ').replace(chr(13), '') rest_call('POST', 'issues/%s/comments' % (number), {'body': comment}) -- cgit v1.2.3