Skip to content

Commit

Permalink
update documentation for PR #141
Browse files Browse the repository at this point in the history
  • Loading branch information
lesstif committed Mar 24, 2018
1 parent 7f2fe47 commit b7367cd
Showing 1 changed file with 60 additions and 6 deletions.
66 changes: 60 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ JIRA_PASS="jira-password-OR-api-token"
# to enable session cookie authorization
# COOKIE_AUTH_ENABLED=true
```
**Note:**

**Important Note:**
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.
Instead of password, you should using [API token](https://confluence.atlassian.com/cloud/api-tokens-938839638.html).

**important-note:** If you are using previous versions(a prior v1.2), you should move config.jira.json to .env and will edit it.

**Laravel Users:**
If you are developing with laravel framework(5.x), you must append above configuration to your application .env file.

## use array
Expand All @@ -84,11 +84,9 @@ $iss = new IssueService(new ArrayConfiguration(
'jiraHost' => 'https://your-jira.host.com',
// for basic authorization:
'jiraUser' => 'jira-username',
'jiraPassword' => 'jira-password',
'jiraPassword' => 'jira-password-OR-api-token',
// to enable session cookie authorization (with basic authorization only)
'cookieAuthEnabled' => true,
// for OAuth authorization:
'oauthAccessToken' => 'access-token',
)
));
```
Expand Down Expand Up @@ -117,6 +115,8 @@ $iss = new IssueService(new ArrayConfiguration(
- [Change assignee](#change-assignee)
- [Remove issue](#remove-issue)
- [Add comment](#add-comment)
- [Get comment](#get-comment)
- [Delete comment](#delete-comment)
- [Perform a transition on an issue](#perform-a-transition-on-an-issue)
- [Perform an advanced search, using the JQL](#perform-an-advanced-search)
- [Simple JQL](#simple-query)
Expand Down Expand Up @@ -711,6 +711,60 @@ COMMENT;

```

#### Get comment

[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-getComments)

```php
<?php
require 'vendor/autoload.php';

use JiraRestApi\Issue\IssueService;
use JiraRestApi\Issue\Comment;
use JiraRestApi\JiraException;

$issueKey = "TEST-879";

try {
$issueService = new IssueService();

$comments = $issueService->getComments($issueKey);

var_dump($comments);

} catch (JiraException $e) {
$this->assertTrue(false, 'get Comment Failed : '.$e->getMessage());
}

```

#### Delete comment

[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-deleteComment)

```php
<?php
require 'vendor/autoload.php';

use JiraRestApi\Issue\IssueService;
use JiraRestApi\Issue\Comment;
use JiraRestApi\JiraException;

$issueKey = "TEST-879";

try {
$commentId = 12345;

$issueService = new IssueService();

$ret = $issueService->deleteComment($issueKey, commentId);

} catch (JiraException $e) {
$this->assertTrue(false, 'Delete comment Failed : '.$e->getMessage());
}

```

#### Perform a transition on an issue

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

0 comments on commit b7367cd

Please sign in to comment.