Skip to content

Commit ddc67d4

Browse files
authored
Jira: Rename tempo_4_timesheets_find_worklogs params (#1273) (#1275)
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
1 parent 726e969 commit ddc67d4

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

atlassian/jira.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,12 +4111,12 @@ def tempo_timesheets_get_worklogs(
41114111
return self.get(url, params=params)
41124112

41134113
# noinspection PyIncorrectDocstring
4114-
def tempo_4_timesheets_find_worklogs(self, **params):
4114+
def tempo_4_timesheets_find_worklogs(self, date_from=None, date_to=None, **params):
41154115
"""
41164116
Find existing worklogs with searching parameters.
41174117
NOTE: check if you are using correct types for the parameters!
4118-
:param from: string From Date
4119-
:param to: string To Date
4118+
:param date_from: string From Date
4119+
:param date_to: string To Date
41204120
:param worker: Array of strings
41214121
:param taskId: Array of integers
41224122
:param taskKey: Array of strings
@@ -4138,6 +4138,11 @@ def tempo_4_timesheets_find_worklogs(self, **params):
41384138
:param offset: integer
41394139
"""
41404140

4141+
if date_from:
4142+
params["from"] = date_from
4143+
if date_to:
4144+
params["to"] = date_to
4145+
41414146
url = "rest/tempo-timesheets/4/worklogs/search"
41424147
return self.post(url, data=params)
41434148

docs/jira.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ TEMPO
539539
# Look at the tempo docs for additional information:
540540
# https://www.tempo.io/server-api-documentation/timesheets#operation/searchWorklogs
541541
# NOTE: check if you are using correct types for the parameters!
542-
# :param from: string From Date
543-
# :param to: string To Date
542+
# :param date_from: string From Date
543+
# :param date_to: string To Date
544544
# :param worker: Array of strings
545545
# :param taskId: Array of integers
546546
# :param taskKey: Array of strings
@@ -560,7 +560,7 @@ TEMPO
560560
# :param pageNo: integer
561561
# :param maxResults: integer
562562
# :param offset: integer
563-
jira.tempo_4_timesheets_find_worklogs(**params)
563+
jira.tempo_4_timesheets_find_worklogs(date_from=None, date_to=None, **params)
564564
565565
# :PRIVATE:
566566
# Get Tempo timesheet worklog by issue key or id.

0 commit comments

Comments
 (0)