Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lesstif committed May 14, 2019
2 parents c0e4e7a + ff20405 commit 7415c37
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/Board/BoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use JiraRestApi\Configuration\ConfigurationInterface;
use JiraRestApi\Issue\Issue;
use JiraRestApi\Sprint\Sprint;
use Psr\Log\LoggerInterface;

class BoardService extends \JiraRestApi\JiraClient
Expand All @@ -17,13 +18,13 @@ public function __construct(ConfigurationInterface $configuration = null, Logger
}

/**
* get all project list.
* get all boards list.
*
* @param array $paramArray
*
* @throws \JiraRestApi\JiraException
*
* @return Project[] array of Project class
* @return Board[] array of Board class
*/
public function getBoardList($paramArray = [])
{
Expand All @@ -48,10 +49,22 @@ public function getBoard($id, $paramArray = [])
public function getBoardIssues($id, $paramArray = [])
{
$json = $this->exec($this->uri.'/'.$id.'/issue'.$this->toHttpQueryParameter($paramArray), null);
$board = $this->json_mapper->mapArray(
$issues = $this->json_mapper->mapArray(
json_decode($json)->issues, new \ArrayObject(), Issue::class
);

return $board;
return $issues;
}

public function getBoardSprints($boardId, $paramArray = [])
{
$json = $this->exec($this->uri.'/'.$boardId.'/sprint'.$this->toHttpQueryParameter($paramArray), null);
$sprints = $this->json_mapper->mapArray(
json_decode($json)->values,
new \ArrayObject(),
Sprint::class
);

return $sprints;
}
}
14 changes: 14 additions & 0 deletions src/Sprint/SprintService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace JiraRestApi\Sprint;

use JiraRestApi\Configuration\ConfigurationInterface;
use JiraRestApi\Issue\Issue;
use JiraRestApi\JiraClient;
use JiraRestApi\JiraException;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -53,4 +54,17 @@ public function getSprint($sprintId)
json_decode($ret), new Sprint()
);
}

public function getSprintIssues($sprintId, $paramArray = [])
{
$json = $this->exec($this->uri.'/'.$sprintId.'/issue'.$this->toHttpQueryParameter($paramArray), null);

$issues = $this->json_mapper->mapArray(
json_decode($json)->issues,
new \ArrayObject(),
Issue::class
);

return $issues;
}
}

0 comments on commit 7415c37

Please sign in to comment.