summaryrefslogtreecommitdiff
path: root/issues.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2013-09-05 00:02:35 +0200
committerFlorian Jung <flo@windfisch.org>2013-09-05 00:02:35 +0200
commit136af04dfe39d7bafae9fc522d56423b938579bc (patch)
treeeccf0a0fa97cf84f1cabf13d60403e423b78f2c5 /issues.py
parent53c3333e7e5bfe0acfd0b88e1bdb4772375d0172 (diff)
Attach labels at creation time -> speedup
Diffstat (limited to 'issues.py')
-rwxr-xr-xissues.py4
1 files changed, 1 insertions, 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})