@@ -640,8 +640,50 @@ def create_worklog(self, accountId, issueId, dateFrom, timeSpentSeconds, billabl
640640
641641 return self .post (url , data = data )
642642
643+ def update_worklog (self , id , accountId , dateFrom , timeSpentSeconds , billableSeconds = None , description = None ,
644+ remainingEstimateSeconds = None , startTime = None ):
645+ """
646+ Updates an existing Worklog using the provided input and returns the updated Worklog.
647+ :param id: The ID of the Worklog to be updated
648+ :param accountId: The Author account ID of the user author
649+ :param dateFrom: The start date of the Worklog
650+ :param timeSpentSeconds: The total amount of time spent in seconds
651+ :param billableSeconds: The amount of seconds billable
652+ :param description: The description of the Worklog
653+ :param remainingEstimateSeconds: The total amount of estimated remaining seconds
654+ :param startTime: The start time of the Worklog
655+
656+ See https://apidocs.tempo.io/#tag/Worklogs/operation/updateWorklog
657+ """
658+
659+ url = f"/worklogs/{ id } "
660+
661+ data = {
662+ "authorAccountId" : str (accountId ),
663+ "startDate" : self ._resolve_date (dateFrom ).isoformat (),
664+ "timeSpentSeconds" : int (timeSpentSeconds ),
665+ }
666+
667+ if billableSeconds :
668+ data ["billableSeconds" ] = int (billableSeconds )
669+ if description :
670+ data ["description" ] = str (description )
671+ if remainingEstimateSeconds :
672+ data ["remainingEstimateSeconds" ] = int (remainingEstimateSeconds )
673+ if startTime :
674+ data ["startTime" ] = self ._resolve_time (startTime ).isoformat ()
675+
676+ return self .put (url , data = data )
643677
678+ def delete_worklog (self , id ):
679+ """
680+ Deletes a Worklog
681+ :param id: The ID of the Worklog to be deleted
644682
683+ See https://apidocs.tempo.io/#tag/Worklogs/operation/deleteWorklog
684+ """
685+ url = f"/worklogs/{ id } "
686+ return self .delete (url )
645687
646688# Customer
647689
0 commit comments