Skip to content

Commit 406bf42

Browse files
committed
Merge pull request #24 from stmh/master
Fix missing comments due to a misnamed key.
2 parents e02aed3 + cbab11f commit 406bf42

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/Issue/IssueField.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ public function addVersion($name)
107107

108108
public function addComment($comment)
109109
{
110-
if (is_null($this->comments)) {
111-
$this->comments = new \JiraRestApi\Issue\Comments();
110+
if (is_null($this->comment)) {
111+
$this->comment = new \JiraRestApi\Issue\Comments();
112112
}
113113

114114
array_push($this->versions, $v);
@@ -129,11 +129,16 @@ public function addLabel($label)
129129

130130
public function setIssueType($name)
131131
{
132-
if (is_null($this->issuetype)) {
133-
$this->issuetype = new \JiraRestApi\Issue\IssueType();
134-
}
132+
if (is_string($name)) {
133+
if (is_null($this->issuetype)) {
134+
$this->issuetype = new \JiraRestApi\Issue\IssueType();
135+
}
135136

136-
$this->issuetype->name = $name;
137+
$this->issuetype->name = $name;
138+
}
139+
else {
140+
$this->issuetype = $name;
141+
}
137142

138143
return $this;
139144
}
@@ -189,7 +194,7 @@ public function getIssueType()
189194
public $components;
190195

191196
/** @var Comments */
192-
public $comments;
197+
public $comment;
193198

194199
/** @var object */
195200
public $votes;

0 commit comments

Comments
 (0)