From ca181c27e3c75f1ec925fd54b36ced2202ed6d86 Mon Sep 17 00:00:00 2001 From: Jeppe Krogh Date: Tue, 23 Jan 2024 12:52:33 +0100 Subject: [PATCH] Corrected some leantime api calls --- src/Service/LeantimeApiService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Service/LeantimeApiService.php b/src/Service/LeantimeApiService.php index 1dd4f9fe..e08c8925 100644 --- a/src/Service/LeantimeApiService.php +++ b/src/Service/LeantimeApiService.php @@ -305,7 +305,7 @@ public function getAllSprints(): array */ public function getTicketsInSprint(string $sprintId): array { - $result = $this->request(self::API_PATH_JSONRPC, 'POST', 'leantime.rpc.tickets.getAll', ['sprint' => $sprintId]); + $result = $this->request(self::API_PATH_JSONRPC, 'POST', 'leantime.rpc.tickets.getAll', ['searchCriteria' => ['sprint' => $sprintId]]); return $result; } @@ -366,7 +366,7 @@ public function getPlanningData(): PlanningData $sprintIssues = []; $allSprints = $this->getAllSprints(); - + foreach ($allSprints as $sprintData) { // Expected sprint name examples: // DEV sprint uge 2-3-4.23 @@ -539,7 +539,7 @@ public function getTimesheetsForTicket(string $ticketId): mixed */ private function getIssuesForProjectMilestone($projectId, $milestoneId): array { - return $this->request(self::API_PATH_JSONRPC, 'POST', 'leantime.rpc.tickets.getAll', ['currentProject' => $projectId, 'milestone' => $milestoneId]); + return $this->request(self::API_PATH_JSONRPC, 'POST', 'leantime.rpc.tickets.getAll', ['searchCriteria' => ['currentProject' => $projectId, 'milestone' => $milestoneId]]); } /** @@ -602,7 +602,7 @@ public function getSprintReportData(string $projectId, string $versionId): Sprin } } $worklogs = $this->getTimesheetsForTicket($issueEntry->id); - + foreach ($worklogs as $worklog) { $workLogStarted = strtotime($worklog->workDate);