From 2e8e1b004c795891a08d2b610d5c6bab333665aa Mon Sep 17 00:00:00 2001 From: gkowalc <> Date: Sat, 3 Feb 2024 21:07:48 +0100 Subject: [PATCH] fixing minor issue in scrap_regex_from_issue method --- atlassian/jira.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/atlassian/jira.py b/atlassian/jira.py index 6a1250779..b195908ac 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -1548,15 +1548,16 @@ def scrap_regex_from_issue(self, issue, regex): comments = issue_output["fields"]["comment"]["comments"] try: - description_matches = [x.group(0) for x in re.finditer(regex, description)] - if description_matches: - regex_output.extend(description_matches) - - for comment in comments: - comment_html = comment["body"] - comment_matches = [x.group(0) for x in re.finditer(regex, comment_html)] - if comment_matches: - regex_output.extend(comment_matches) + if description is not None: + description_matches = [x.group(0) for x in re.finditer(regex, description)] + if description_matches: + regex_output.extend(description_matches) + + for comment in comments: + comment_html = comment["body"] + comment_matches = [x.group(0) for x in re.finditer(regex, comment_html)] + if comment_matches: + regex_output.extend(comment_matches) return regex_output except HTTPError as e: