Skip to content

Commit

Permalink
Applied hotfix for pycontribs/jira#1775 in get_jira_events.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderMakarov committed Dec 24, 2023
1 parent 04d5c78 commit af899dc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions get_jira_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ def _get_jira_issues(
assert api_token, "Jira login API token is not specified."
assert projects, "Jira projects to consider are not specified."
assert search_datetime, "Date to search is not specified."
connection = jira.JIRA(server=server_url, basic_auth=(email, api_token))
connection = jira.JIRA(
server=server_url,
basic_auth=(email, api_token),
# See https://github.com/pycontribs/jira/issues/1775 for patch below.
options={"headers": {"Accept": "application/json;q=1.0, */*;q=0.9"}},
)
LOG.info("Searching %s issues updated after %s and touched by %s.", projects, search_datetime, email)
jql = (
f"project IN ({','.join(projects)}) AND updated >= '{search_datetime.strftime('%Y-%m-%d %H:%M')}' AND "
Expand Down Expand Up @@ -133,8 +138,9 @@ def _format_jira_event_for_log(event: Event) -> str:
return f"{{{datetime_to_time_str(event.timestamp)} {data['jira_id']} {change_desc}}}"


def get_one_day_events_from_jira(issues: List[jira.Issue], author_email: str, start_datetime: datetime.datetime)\
-> List[Event]:
def get_one_day_events_from_jira(
issues: List[jira.Issue], author_email: str, start_datetime: datetime.datetime
) -> List[Event]:
"""
Filters all issues by one day and specified author. Collects events from them.
:param issues: Jira issues to inspect in chronological order.
Expand Down

0 comments on commit af899dc

Please sign in to comment.