Skip to content

Commit 1648c74

Browse files
committed
fixed #223 doc for Updates an existing comment.
1 parent b0ae381 commit 1648c74

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ $iss = new IssueService(new ArrayConfiguration(
136136
- [Update Fix Versions](#update-fix-versions)
137137
- [Change assignee](#change-assignee)
138138
- [Remove issue](#remove-issue)
139-
- [Add comment](#add-comment)
140-
- [Get comment](#get-comment)
141-
- [Delete comment](#delete-comment)
142139
- [Perform a transition on an issue](#perform-a-transition-on-an-issue)
143140
- [Perform an advanced search, using the JQL](#perform-an-advanced-search)
144141
- [Simple JQL](#simple-query)
@@ -154,6 +151,12 @@ $iss = new IssueService(new ArrayConfiguration(
154151
- [Add watcher to Issue](#add-watcher-to-issue)
155152
- [Send a notification to the recipients](#issue-notify)
156153

154+
### Comment
155+
- [Add comment](#add-comment)
156+
- [Get comment](#get-comment)
157+
- [Delete comment](#delete-comment)
158+
- [Update comment](#update-comment)
159+
157160
### IssueLink
158161

159162
* [Create Issue Link](#create-issue-link)
@@ -987,6 +990,36 @@ try {
987990

988991
```
989992

993+
#### Update comment
994+
995+
[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-updateComment)
996+
997+
```php
998+
<?php
999+
require 'vendor/autoload.php';
1000+
1001+
use JiraRestApi\Issue\IssueService;
1002+
use JiraRestApi\JiraException;
1003+
use JiraRestApi\Issue\Comment;
1004+
1005+
$issueKey = "TEST-879";
1006+
1007+
try {
1008+
$commentId = 12345;
1009+
1010+
$issueService = new IssueService();
1011+
1012+
$comment = new Comment();
1013+
$comment->setBody('Updated comments');
1014+
1015+
$issueService->updateComment($issueKey, $commentId, $comment);
1016+
1017+
} catch (JiraException $e) {
1018+
$this->assertTrue(false, 'Delete comment Failed : '.$e->getMessage());
1019+
}
1020+
1021+
```
1022+
9901023
#### Perform a transition on an issue
9911024

9921025
Note: this library uses goal **status names** instead of **transition names**.

0 commit comments

Comments
 (0)