diff --git a/src/plugins/plugin_tickets_import.py b/src/plugins/plugin_tickets_import.py index 0a6c3969..f645de58 100755 --- a/src/plugins/plugin_tickets_import.py +++ b/src/plugins/plugin_tickets_import.py @@ -73,7 +73,11 @@ class TicketsImportPlugin(object): 'version': version of the product/component concerned by this ticket 'platform': platform converned by this ticket 'os': operating system concerned by this ticket - 'status': current status of the ticket + 'status': current status of the ticket, values: + - "queued": ticket is waiting + - "started": progress is ongoing + - "review": ticket is fixed and waiting for review + - "closed": ticket is finished or invalid 'milestone': target milestone for this ticket """ if not 'schema' in session: diff --git a/src/plugins/plugin_tickets_import_bugzilla.py b/src/plugins/plugin_tickets_import_bugzilla.py index 05b4bbcb..c02ce22b 100755 --- a/src/plugins/plugin_tickets_import_bugzilla.py +++ b/src/plugins/plugin_tickets_import_bugzilla.py @@ -48,9 +48,17 @@ Tickets will be uploaded with the same ID as for Bugzilla, any existing ticket w location: you must use the absolute path to your .xml file """) +STATUS_MAP = { + 'NEW': 'queued', + 'ASSIGNED': 'started', + 'RESOLVED': 'review', + 'CLOSED': 'closed', + 'REOPENED': 'started' # we loose data here because there is no need on basic workflow to have a reopened status +} + class BugzillaParser(object): - + # TODO: add a way to reassign values def parse(self, file_path): tickets = [] @@ -69,14 +77,14 @@ class BugzillaParser(object): ticket['assigned_to_name'] = assigned_to_elt.get('name') ticket['assigned_to_email'] = assigned_to_elt.text ticket['cc_emails'] = [e.text for e in bug.findall('cc')] - ticket['priority'] = bug.findtext('priority') - ticket['severity'] = bug.findtext('bug_severity') + ticket['priority'] = bug.findtext('priority').lower().strip() + ticket['severity'] = bug.findtext('bug_severity').lower().strip() ticket['product'] = bug.findtext('product') ticket['component'] = bug.findtext('component') ticket['version'] = bug.findtext('version') ticket['platform'] = bug.findtext('rep_platform') ticket['os'] = bug.findtext('op_sys') - ticket['status'] = bug.findtext('bug_status') + ticket['status'] = STATUS_MAP.get(bug.findtext('bug_status'), 'queued') ticket['milestone'] = bug.findtext('target_milestone')