Skip to content

Commit

Permalink
Update comment endpoint
Browse files Browse the repository at this point in the history
----------------------------------

- Adjust documentation to retrieve all comments (Issue ID is required)
- Allow to create new comments
- Update comment default fields
  • Loading branch information
doishub committed May 17, 2023
1 parent 2494785 commit 8d88eb2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
10 changes: 7 additions & 3 deletions docs/issues/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $youtrack->issues()
->comments()
```

##### `all()`
##### `all($issueId)`
Returns all issue comments.

##### `one($issueId, $commentId)`
Expand All @@ -18,8 +18,12 @@ Returns a specific issue based on the issue and comment ID.
'textPreview',
'created',
'updated',
'author',
'issue',
'author' => [
'name'
],
'issue' => [
'idReadable'
],
'attachments',
'visibility',
'deleted'
Expand Down
16 changes: 14 additions & 2 deletions src/Api/Issue/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ protected function defaultFields(): self
'textPreview',
'created',
'updated',
'author',
'issue',
'author' => [
'name'
],
'issue' => [
'idReadable'
],
'attachments',
'visibility',
'deleted'
Expand All @@ -42,4 +46,12 @@ public function one(string $issueId, string $commentId): array
{
return $this->get("issues/$issueId/comments/$commentId");
}

/**
* Create issue comment.
*/
public function create(string $issueId, array $parameter): array
{
return $this->post("issues/$issueId/comments", $parameter);
}
}

0 comments on commit 8d88eb2

Please sign in to comment.