Skip to content

Commit b7367cd

Browse files
committed
update documentation for PR #141
1 parent 7f2fe47 commit b7367cd

File tree

1 file changed

+60
-6
lines changed

1 file changed

+60
-6
lines changed

README.md

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ JIRA_PASS="jira-password-OR-api-token"
6363
# to enable session cookie authorization
6464
# COOKIE_AUTH_ENABLED=true
6565
```
66-
**Note:**
66+
67+
**Important Note:**
6768
As of March 15, 2018, in accordance to the [Atlassian REST API Policy](https://developer.atlassian.com/platform/marketplace/atlassian-rest-api-policy/), Basic auth with password to be deprecated.
6869
Instead of password, you should using [API token](https://confluence.atlassian.com/cloud/api-tokens-938839638.html).
6970

70-
**important-note:** If you are using previous versions(a prior v1.2), you should move config.jira.json to .env and will edit it.
71-
71+
**Laravel Users:**
7272
If you are developing with laravel framework(5.x), you must append above configuration to your application .env file.
7373

7474
## use array
@@ -84,11 +84,9 @@ $iss = new IssueService(new ArrayConfiguration(
8484
'jiraHost' => 'https://your-jira.host.com',
8585
// for basic authorization:
8686
'jiraUser' => 'jira-username',
87-
'jiraPassword' => 'jira-password',
87+
'jiraPassword' => 'jira-password-OR-api-token',
8888
// to enable session cookie authorization (with basic authorization only)
8989
'cookieAuthEnabled' => true,
90-
// for OAuth authorization:
91-
'oauthAccessToken' => 'access-token',
9290
)
9391
));
9492
```
@@ -117,6 +115,8 @@ $iss = new IssueService(new ArrayConfiguration(
117115
- [Change assignee](#change-assignee)
118116
- [Remove issue](#remove-issue)
119117
- [Add comment](#add-comment)
118+
- [Get comment](#get-comment)
119+
- [Delete comment](#delete-comment)
120120
- [Perform a transition on an issue](#perform-a-transition-on-an-issue)
121121
- [Perform an advanced search, using the JQL](#perform-an-advanced-search)
122122
- [Simple JQL](#simple-query)
@@ -711,6 +711,60 @@ COMMENT;
711711

712712
```
713713

714+
#### Get comment
715+
716+
[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-getComments)
717+
718+
```php
719+
<?php
720+
require 'vendor/autoload.php';
721+
722+
use JiraRestApi\Issue\IssueService;
723+
use JiraRestApi\Issue\Comment;
724+
use JiraRestApi\JiraException;
725+
726+
$issueKey = "TEST-879";
727+
728+
try {
729+
$issueService = new IssueService();
730+
731+
$comments = $issueService->getComments($issueKey);
732+
733+
var_dump($comments);
734+
735+
} catch (JiraException $e) {
736+
$this->assertTrue(false, 'get Comment Failed : '.$e->getMessage());
737+
}
738+
739+
```
740+
741+
#### Delete comment
742+
743+
[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-deleteComment)
744+
745+
```php
746+
<?php
747+
require 'vendor/autoload.php';
748+
749+
use JiraRestApi\Issue\IssueService;
750+
use JiraRestApi\Issue\Comment;
751+
use JiraRestApi\JiraException;
752+
753+
$issueKey = "TEST-879";
754+
755+
try {
756+
$commentId = 12345;
757+
758+
$issueService = new IssueService();
759+
760+
$ret = $issueService->deleteComment($issueKey, commentId);
761+
762+
} catch (JiraException $e) {
763+
$this->assertTrue(false, 'Delete comment Failed : '.$e->getMessage());
764+
}
765+
766+
```
767+
714768
#### Perform a transition on an issue
715769

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

0 commit comments

Comments
 (0)