Skip to content

Commit

Permalink
Just additional checker (#394)
Browse files Browse the repository at this point in the history
* Add Jira issue regex matcher
  • Loading branch information
gonchik authored Nov 23, 2019
1 parent 69e5038 commit 09ac14e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
import logging

import re
from requests.exceptions import HTTPError
from .rest_client import AtlassianRestAPI

Expand Down Expand Up @@ -576,8 +576,13 @@ def bulk_issue(self, issue_list, fields='*all'):
:param list issue_list:
:return:
"""
jira_issue_regex = re.compile('[A-Z]{1,10}-\d+')
missing_issues = list()
jql = 'key in ({})'.format(', '.join(['"{}"'.format(key) for key in issue_list]))
matched_issue_keys = list()
for key in issue_list:
if re.match(jira_issue_regex, key):
matched_issue_keys.append(key)
jql = 'key in ({})'.format(', '.join(matched_issue_keys))
query_result = self.jql(jql, fields=fields)
if 'errorMessages' in query_result.keys():
for message in query_result['errorMessages']:
Expand Down

0 comments on commit 09ac14e

Please sign in to comment.