Skip to content

Commit b5424d3

Browse files
authored
Merge pull request #247 from ghunti/get_board_sprints
Add capability to retrieve all board sprints
2 parents c57df95 + 81b23e0 commit b5424d3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/Board/BoardService.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use JiraRestApi\Configuration\ConfigurationInterface;
66
use JiraRestApi\Issue\Issue;
7+
use JiraRestApi\Sprint\Sprint;
78
use Psr\Log\LoggerInterface;
89

910
class BoardService extends \JiraRestApi\JiraClient
@@ -48,10 +49,22 @@ public function getBoard($id, $paramArray = [])
4849
public function getBoardIssues($id, $paramArray = [])
4950
{
5051
$json = $this->exec($this->uri.'/'.$id.'/issue'.$this->toHttpQueryParameter($paramArray), null);
51-
$board = $this->json_mapper->mapArray(
52+
$issues = $this->json_mapper->mapArray(
5253
json_decode($json)->issues, new \ArrayObject(), Issue::class
5354
);
5455

55-
return $board;
56+
return $issues;
57+
}
58+
59+
public function getBoardSprints($boardId, $paramArray = [])
60+
{
61+
$json = $this->exec($this->uri.'/'.$boardId.'/sprint'.$this->toHttpQueryParameter($paramArray), null);
62+
$sprints = $this->json_mapper->mapArray(
63+
json_decode($json)->values,
64+
new \ArrayObject(),
65+
Sprint::class
66+
);
67+
68+
return $sprints;
5669
}
5770
}

0 commit comments

Comments
 (0)