From 64158c9cac6ddd5a6623a9e281b80197d34ca273 Mon Sep 17 00:00:00 2001 From: sidpremkumar Date: Sep 11 2019 15:40:44 +0000 Subject: Remove converting markdown by default, now optional flag that needs to be placed in the updates array --- diff --git a/README.rst b/README.rst index c580a77..4e1d671 100644 --- a/README.rst +++ b/README.rst @@ -45,7 +45,8 @@ 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. + 'labels': ['tag1'..] :: Optional field to have custom set labels on all downstream issues created. + 'github_markdown' :: If description syncing is turned on, this flag will convert Github markdown to plaintext. 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/docs/source/config-file.rst b/docs/source/config-file.rst index 733e35e..19a12e5 100644 --- a/docs/source/config-file.rst +++ b/docs/source/config-file.rst @@ -87,7 +87,11 @@ getting a JIRA client and failure email will be sent anytime the service fails. * Sync title * :code:`{'transition': True/'CUSTOM_TRANSITION'}` * Sync status (open/closed), Sync only status/Attempt to transition JIRA ticket to CUSTOM_TRANSITION on upstream closure - + * :code:`labels': ['tag1'..]` + * Optional field to have custom set labels on all downstream issues created. + * :code:`github_markdown` + * If description syncing is turned on, this flag will convert Github markdown to plaintext. This uses the pypandoc module. + .. note:: :Overwrite: Setting this to :code:`True` will ensure that Upstream (GitHub or Pagure) values will overwrite downstream ones (i.e. if its empty upstream it'll be empty downstream) diff --git a/sync2jira/downstream.py b/sync2jira/downstream.py index cac702c..a959a71 100644 --- a/sync2jira/downstream.py +++ b/sync2jira/downstream.py @@ -1059,8 +1059,8 @@ def sync_with_jira(issue, config): if not config['sync2jira']['develop'] and not check_jira_status(client): log.warning(' The JIRA server looks like its down. Shutting down...') raise JIRAError - - if issue.source == 'github' and issue.content: + if issue.source == 'github' and issue.content and \ + 'github_markdown' in issue.downstream['updates']: issue.content = pypandoc.convert_text(issue.content, 'plain', format='md') # First, check to see if we have a matching issue using the new method.