diff --git a/github_jira_sync_app/main.py b/github_jira_sync_app/main.py index 05309c4..7433e6a 100644 --- a/github_jira_sync_app/main.py +++ b/github_jira_sync_app/main.py @@ -211,7 +211,7 @@ async def bot(request: Request, payload: dict = Body(...)): jira = JIRA(jira_instance_url, basic_auth=(jira_username, jira_token)) jira_task_desc_match = f"This issue was created from GitHub Issue {issue.html_url}" existing_issues = jira.search_issues( - f'project={settings["jira_project_key"]} AND description ~""{jira_task_desc_match}""', + rf'project={settings["jira_project_key"]} AND description ~"\"{jira_task_desc_match}\""', json_result=False, ) assert isinstance(existing_issues, list), "Jira did not return a list of existing issues" diff --git a/tests/unit/url_responses/issue_labeled_correct.yaml b/tests/unit/url_responses/issue_labeled_correct.yaml index d926d14..c339544 100644 --- a/tests/unit/url_responses/issue_labeled_correct.yaml +++ b/tests/unit/url_responses/issue_labeled_correct.yaml @@ -27,5 +27,5 @@ responses: content_type: text/plain method: GET status: 200 - url: https://my-jira.atlassian.net/rest/api/2/search?jql=project%3DMTC+AND+description+~%22%22This+issue+was+created+from+GitHub+Issue+https%3A%2F%2Fgithub.com%2Fbeliaev-maksim%2Ftest-ci%2Fissues%2F30%22%22&startAt=0&validateQuery=True&fields=%2Aall&maxResults=50 + url: https://my-jira.atlassian.net/rest/api/2/search?jql=project%3DMTC+AND+description+~%22%5C%22This+issue+was+created+from+GitHub+Issue+https%3A%2F%2Fgithub.com%2Fbeliaev-maksim%2Ftest-ci%2Fissues%2F30%5C%22%22&startAt=0&validateQuery=True&fields=%2Aall&maxResults=50