From 450149dbc5369f94061b024aede5c1537c9cc0cc Mon Sep 17 00:00:00 2001 From: Bohdan Iakymets Date: May 03 2019 12:48:51 +0000 Subject: Added support for custom fields and custom ticket type for repository --- diff --git a/sync2jira/downstream.py b/sync2jira/downstream.py index 6f28348..4167650 100644 --- a/sync2jira/downstream.py +++ b/sync2jira/downstream.py @@ -167,10 +167,12 @@ def _create_jira_issue(client, issue, config): log.info(" Testing flag is true. Skipping actual creation.") return + custom_fields = issue.downstream.get('custom_fields', {}) + default_type = issue.downstream.get('type', "Bug") kwargs = dict( summary=issue.title, description=issue.url, - issuetype=dict(name="Story" if "RFE" in issue.title else "Bug"), + issuetype=dict(name="Story" if "RFE" in issue.title else default_type), ) if issue.downstream['project']: kwargs['project'] = dict(key=issue.downstream['project']) @@ -183,6 +185,9 @@ def _create_jira_issue(client, issue, config): labels = [labels] kwargs['labels'] = labels + for key, custom_field in custom_fields.items(): + kwargs[key] = custom_field + log.info("Creating issue.") downstream = client.create_issue(**kwargs)