Skip to content

Commit 4ef3b19

Browse files
author
Artur (Seti) Łabudziński
committed
Proper Assignee (not Reporter)
Added $key to jira response and parser
1 parent fcd0362 commit 4ef3b19

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

src/Issue/Assignee.php

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace Jira\Api\Issue;
4+
5+
class Assignee implements \JsonSerializable
6+
{
7+
/* @var string */
8+
public $self;
9+
10+
/* @var string */
11+
public $name;
12+
13+
/* @var string */
14+
public $key;
15+
16+
/* @var string */
17+
public $emailAddress;
18+
19+
/* @var string */
20+
public $avatarUrls;
21+
22+
/* @var string */
23+
public $displayName;
24+
25+
/* @var string */
26+
public $active;
27+
28+
public function jsonSerialize()
29+
{
30+
return array_filter(get_object_vars($this));
31+
}
32+
}

src/Issue/IssueField.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct($updateIssue = false)
2727
if ($updateIssue != true) {
2828
$this->project = new \Jira\Api\Project\Project();
2929

30-
$this->assignee = new \Jira\Api\Issue\Reporter();
30+
$this->assignee = new \Jira\Api\Issue\Assignee();
3131
$this->priority = new \Jira\Api\Issue\Priority();
3232
$this->versions = array();
3333

@@ -98,7 +98,7 @@ public function setWorklog($wl)
9898
public function setAssigneeName($name)
9999
{
100100
if (is_null($this->assignee)) {
101-
$this->assignee = new \Jira\Api\Issue\Reporter();
101+
$this->assignee = new \Jira\Api\Issue\Assignee();
102102
}
103103

104104
$this->assignee->name = $name;
@@ -249,7 +249,7 @@ public function getIssueType()
249249
/** @var Worklogs */
250250
public $worklog;
251251

252-
/** @var Reporter */
252+
/** @var Assignee */
253253
public $assignee;
254254

255255
/** @var \Jira\Api\Issue\Version[] */

src/Issue/Reporter.php

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ class Reporter implements \JsonSerializable
1010
/* @var string */
1111
public $name;
1212

13+
/* @var string */
14+
public $key;
15+
1316
/* @var string */
1417
public $emailAddress;
1518

0 commit comments

Comments
 (0)