Skip to content

Commit 67574e5

Browse files
Add new Services (#366)
* Add new Services Add StatusCategoryService Add IssueTypeService * Fix replace Tabs with Spaces * Remove IssueType\IssueType Replace IssueType\IssueType with Issue\IssueType in IsssueTypeService Add avatarId Property to Issue\IssueType Co-authored-by: Christian Ziermann <[email protected]>
1 parent bb4b24c commit 67574e5

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

src/Issue/IssueType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class IssueType implements \JsonSerializable
2525
/** @var \JiraRestApi\Issue\IssueStatus[] */
2626
public $statuses;
2727

28+
/** @var integer */
29+
public $avatarId;
30+
2831
public function jsonSerialize()
2932
{
3033
return array_filter(get_object_vars($this));

src/IssueType/IssueTypeService.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace JiraRestApi\IssueType;
4+
5+
use JiraRestApi\JiraException;
6+
use JsonMapper_Exception;
7+
8+
class IssueTypeService extends \JiraRestApi\JiraClient
9+
{
10+
private $uri = '/issuetype';
11+
12+
/**
13+
* get all issuetypes.
14+
*
15+
* @throws JiraException
16+
* @throws JsonMapper_Exception
17+
*
18+
* @return IssueType[] array of Project class
19+
*/
20+
public function getAll()
21+
{
22+
$ret = $this->exec($this->uri.'/', null);
23+
$this->log->info("Result=\n".$ret);
24+
25+
return $this->json_mapper->mapArray(
26+
json_decode($ret, false),
27+
new \ArrayObject(),
28+
\JiraRestApi\Issue\IssueType::class
29+
);
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace JiraRestApi\StatusCategory;
4+
5+
use JiraRestApi\JiraException;
6+
use JsonMapper_Exception;
7+
8+
class StatusCategoryService extends \JiraRestApi\JiraClient
9+
{
10+
private $uri = '/statuscategory';
11+
12+
/**
13+
* get all statuscategorys.
14+
*
15+
* @throws JiraException
16+
* @throws JsonMapper_Exception
17+
*
18+
* @return Statuscategory[] array of Project class
19+
*/
20+
public function getAll()
21+
{
22+
$ret = $this->exec($this->uri.'/', null);
23+
$this->log->info("Result=\n".$ret);
24+
25+
return $this->json_mapper->mapArray(
26+
json_decode($ret, false),
27+
new \ArrayObject(),
28+
\JiraRestApi\Issue\Statuscategory::class
29+
);
30+
}
31+
}

0 commit comments

Comments
 (0)