Skip to content

Commit

Permalink
Jira: Rename tempo_4_timesheets_find_worklogs params (#1273) (#1275)
Browse files Browse the repository at this point in the history
Rename the parameters of Jira.tempo_4_timesheets_find_worklogs as follows:
- from -> date_from
  - "from" is a keyword, so it cannot be used as a parameter name
  - "date_from" is also used in Jira.tempo_timesheets_get_worklogs
  - See #1273
- to -> date_to
  - renamed for consistency with date_from
  • Loading branch information
anttipalsola authored Nov 25, 2023
1 parent 726e969 commit ddc67d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -4111,12 +4111,12 @@ def tempo_timesheets_get_worklogs(
return self.get(url, params=params)

# noinspection PyIncorrectDocstring
def tempo_4_timesheets_find_worklogs(self, **params):
def tempo_4_timesheets_find_worklogs(self, date_from=None, date_to=None, **params):
"""
Find existing worklogs with searching parameters.
NOTE: check if you are using correct types for the parameters!
:param from: string From Date
:param to: string To Date
:param date_from: string From Date
:param date_to: string To Date
:param worker: Array of strings
:param taskId: Array of integers
:param taskKey: Array of strings
Expand All @@ -4138,6 +4138,11 @@ def tempo_4_timesheets_find_worklogs(self, **params):
:param offset: integer
"""

if date_from:
params["from"] = date_from
if date_to:
params["to"] = date_to

url = "rest/tempo-timesheets/4/worklogs/search"
return self.post(url, data=params)

Expand Down
6 changes: 3 additions & 3 deletions docs/jira.rst
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ TEMPO
# Look at the tempo docs for additional information:
# https://www.tempo.io/server-api-documentation/timesheets#operation/searchWorklogs
# NOTE: check if you are using correct types for the parameters!
# :param from: string From Date
# :param to: string To Date
# :param date_from: string From Date
# :param date_to: string To Date
# :param worker: Array of strings
# :param taskId: Array of integers
# :param taskKey: Array of strings
Expand All @@ -560,7 +560,7 @@ TEMPO
# :param pageNo: integer
# :param maxResults: integer
# :param offset: integer
jira.tempo_4_timesheets_find_worklogs(**params)
jira.tempo_4_timesheets_find_worklogs(date_from=None, date_to=None, **params)
# :PRIVATE:
# Get Tempo timesheet worklog by issue key or id.
Expand Down

0 comments on commit ddc67d4

Please sign in to comment.