From 075c338cf7203e6e66296051e4ff4adea1e65607 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Oct 05 2016 13:08:41 +0000 Subject: Be satisfied with issues closed as duplicate as well. This is the half-way fix for #1: https://pagure.io/sync-to-jira/issue/1 There is a better, longer-term fix forthcoming. --- diff --git a/sync2jira/downstream.py b/sync2jira/downstream.py index a60fbc7..2673831 100644 --- a/sync2jira/downstream.py +++ b/sync2jira/downstream.py @@ -34,7 +34,7 @@ def get_existing_jira_issues(downstream, config): query = " AND ".join([ "=".join([k, v]) for k, v in downstream.items() if v is not None - ]) + " AND resolution is null" + ]) + " AND (resolution is null OR resolution = Duplicate)" results = client.search_issues(query) # TODO -- handle pagination here... jira_cache[key] = results diff --git a/tests/test_downstream.py b/tests/test_downstream.py index 0e15d5a..1b336e1 100644 --- a/tests/test_downstream.py +++ b/tests/test_downstream.py @@ -31,7 +31,7 @@ class TestDownstream(unittest.TestCase): # Make sure we called search issues really only once client.return_value.search_issues.assert_called_once_with( - 'key=value AND resolution is null', + 'key=value AND (resolution is null OR resolution = Duplicate)', ) @mock.patch('jira.client.JIRA')