diff options
author | cpettet <rush@wikimedia.org> | 2014-12-14 19:29:55 -0600 |
---|---|---|
committer | cpettet <rush@wikimedia.org> | 2014-12-14 19:29:55 -0600 |
commit | 08ca3e6d00133740c9adb62233f97bb802c6889f (patch) | |
tree | f061e58446d8e33a3e052e4d6fea5c8b68436b69 | |
parent | 51d54f4a314f978aaf713a91e0df764aa5d58f90 (diff) |
add old bz reference to migrated rt issues
re key the xcomment dict
-rwxr-xr-x | rt_create.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rt_create.py b/rt_create.py index 8a202cd..62c6434 100755 --- a/rt_create.py +++ b/rt_create.py @@ -358,7 +358,7 @@ def create(rtid): for at in hafound: if at in upfiles: header_attachments.append('{F%s}' % uploaded[at]['id']) - if 'CF.{Bugzilla ticket}' in rtinfo or header_attachments: + if 'CF.{Bugzilla ticket}' in rtinfo and rtinfo['CF.{Bugzilla ticket}'] or header_attachments: full_description += '\n__________________________\n\n' if 'CF.{Bugzilla ticket}' in rtinfo and rtinfo['CF.{Bugzilla ticket}']: obzurl = 'https://old-bugzilla.wikimedia.org/show_bug.cgi?id=' @@ -367,7 +367,7 @@ def create(rtid): rtinfo['CF.{Bugzilla ticket}'],) bzref = int(rtinfo['CF.{Bugzilla ticket}'].strip()) newbzref = bzref + 2000 - full_description += "Bugzilla Ticket: %s => %s\n" % (obz, '{T%s}' % (newbzref,)) + full_description += "**Bugzilla Ticket**: %s => %s\n" % (obz, '{T%s}' % (newbzref,)) if header_attachments: full_description += '\n'.join(header_attachments) @@ -463,6 +463,7 @@ def create(rtid): cbody += '\n__________________________\n\n' cbody += '\n'.join(cbody_attachments) fmt_comment['xattached'] = cbody_attachments + phabm.task_comment(ticket['id'], preamble + cbody) ctransaction = phabdb.last_comment(ticket['phid']) @@ -483,7 +484,8 @@ def create(rtid): fmt_comment['created'] = created # XXX TRX both ways? #fmt_comment['creator'] = dbody['creator']user_lookup(name) - fmt_comments[created] = fmt_comment + cid = len(fmt_comments.keys()) + 1 + fmt_comments[cid] = fmt_comment if rtinfo['Status'].lower() != 'open': log('setting %s to status %s' % (rtid, rtinfo['xstatus'].lower())) |