From 9eef88e5583778e7333839e1b629544a32dfa5b5 Mon Sep 17 00:00:00 2001 From: sidpremkumar Date: Sep 06 2019 20:02:46 +0000 Subject: Fixing cutstom labels downstream feature and updating README --- diff --git a/README.rst b/README.rst index 19b4c11..c580a77 100644 --- a/README.rst +++ b/README.rst @@ -27,7 +27,8 @@ Each project is accompanied by an 'updates' array as seen below:: 'Demo_project': {'project': 'PROJECT', 'component': 'COMP', 'updates': [...], 'owner': 'project_owner_username', - 'default_status': 'start_status_for_issue'}, + 'default_status': 'start_status_for_issue' + 'labels: ['tag1'..]}, The following can be added to the updates array to specify what to sync with downstream @@ -44,6 +45,7 @@ JIRA issues:: {'transition': True/'CUSTOM_TRANSITION'} :: Sync status (open/closed), Sync only status/ Attempt to transition JIRA ticket to CUSTOM_TRANSITION on upstream closure + 'labels: ['tag1'..] :: Optional field to have custom set labels on all downstream issues created. Note: Overwrite set to True will ensure that upstream issue fields will clear downstream issue fields, overwrite set to False will never delete downstream issue fields only append. diff --git a/sync2jira/downstream.py b/sync2jira/downstream.py index a3ed48e..f6eaac5 100644 --- a/sync2jira/downstream.py +++ b/sync2jira/downstream.py @@ -588,6 +588,10 @@ def _create_jira_issue(client, issue, config): for key, custom_field in custom_fields.items(): kwargs[key] = custom_field + # Add labels if needed + if 'labels' in issue.downstream.keys(): + kwargs['labels'] = issue.downstream['labels'] + log.info(" Creating issue.") downstream = client.create_issue(**kwargs)