Skip to content

Commit a8ade68

Browse files
author
Antonin Rykalsky
committed
feat: extend worklog function with attributes parameter
1 parent 90c943d commit a8ade68

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ There are also functions to retrieve `user` and `team`-specific worklogs.
6868
timeSpentSeconds=3600,
6969
description="Something",
7070
startTime="17:00:00"
71+
attributes=[{_WorkType_: "Development"}]
7172
)
7273

7374
#### Update Worklog

tempoapiclient/client_v4.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ def search_worklogs(self, dateFrom, dateTo, updatedFrom=None, authorIds=None, is
606606
return self.post(url, params=params, data=data)
607607

608608
def create_worklog(self, accountId, issueId, dateFrom, timeSpentSeconds, billableSeconds=None, description=None,
609-
remainingEstimateSeconds=None, startTime=None):
609+
remainingEstimateSeconds=None, startTime=None, attributes=None):
610610
"""
611611
Creates a new Worklog using the provided input and returns the newly created Worklog.
612612
:param accountId:
@@ -617,6 +617,7 @@ def create_worklog(self, accountId, issueId, dateFrom, timeSpentSeconds, billabl
617617
:param description:
618618
:param remainingEstimateSeconds:
619619
:param startTime:
620+
:param attributes:
620621
"""
621622

622623
url = f"/worklogs"
@@ -625,7 +626,8 @@ def create_worklog(self, accountId, issueId, dateFrom, timeSpentSeconds, billabl
625626
"authorAccountId": str(accountId),
626627
"issueId": int(issueId),
627628
"startDate": self._resolve_date(dateFrom).isoformat(),
628-
"timeSpentSeconds": int(timeSpentSeconds)
629+
"timeSpentSeconds": int(timeSpentSeconds),
630+
"attributes": attributes
629631
}
630632

631633
if billableSeconds:

0 commit comments

Comments
 (0)