[DOCS] Add get case comments API (#128694)

This commit is contained in:
Lisa Cawley 2022-03-29 10:07:51 -07:00 committed by GitHub
parent 7039878471
commit c3fba606d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 86 additions and 7 deletions

View file

@ -13,9 +13,8 @@ these APIs:
* {security-guide}/cases-api-find-cases-by-alert.html[Find cases by alert]
* <<cases-api-find-connectors>>
* {security-guide}/cases-api-get-case-activity.html[Get all case activity]
* {security-guide}/cases-api-get-all-case-comments.html[Get all case comments]
* <<cases-api-get-case>>
* {security-guide}/cases-api-get-comment.html[Get comment]
* <<cases-api-get-comments>>
* {security-guide}/cases-get-connector.html[Get current connector]
* {security-guide}/cases-api-get-reporters.html[Get reporters]
* {security-guide}/cases-api-get-status.html[Get status]
@ -36,5 +35,6 @@ include::cases/cases-api-find-cases.asciidoc[leveloffset=+1]
include::cases/cases-api-find-connectors.asciidoc[leveloffset=+1]
//GET
include::cases/cases-api-get-case.asciidoc[leveloffset=+1]
include::cases/cases-api-get-comments.asciidoc[leveloffset=+1]
//UPDATE
include::cases/cases-api-update.asciidoc[leveloffset=+1]

View file

@ -30,9 +30,9 @@ You must have `all` privileges for the *Cases* feature in the *Management*,
<<cases-api-find-cases>>.
`<comment_id>`::
(Optional, string) The identifier for the comment.
//To retrieve comment IDs, use <<cases-api-get-all-case-comments>>.
If it is not specified, all comments are deleted.
(Optional, string) The identifier for the comment. To retrieve comment IDs, use
<<cases-api-get-case>> or <<cases-api-find-cases>>. If it is not specified, all
comments are deleted.
<space_id>::
(Optional, string) An identifier for the space. If it is not specified, the

View file

@ -0,0 +1,80 @@
[[cases-api-get-comments]]
== Get comments API
++++
<titleabbrev>Get comments</titleabbrev>
++++
Gets a comment or all comments for a case.
=== Request
`GET <kibana host>:<port>/api/cases/<case ID>/comments/<comment ID>`
`GET <kibana host>:<port>/s/<space_id>/api/cases/<case ID>/comments/<comment ID>`
`GET <kibana host>:<port>/api/cases/<case_id>/comments` deprecated:[8.1.0]
`GET <kibana host>:<port>/s/<space_id>/api/cases/<case_id>/comments` deprecated:[8.1.0]
=== Prerequisite
You must have `read` privileges for the *Cases* feature in the *Management*,
*{observability}*, or *Security* section of the
<<kibana-feature-privileges,{kib} feature privileges>>, depending on the
`owner` of the cases with the comments you're seeking.
=== Path parameters
`<case_id>`::
(Required, string) The identifier for the case. To retrieve case IDs, use
<<cases-api-find-cases>>.
`<comment_id>`::
(Optional, string) The identifier for the comment. To retrieve comment IDs, use
<<cases-api-get-case>>.
+
If it is not specified, all comments are retrieved.
deprecated:[8.1.0,The comment identifier will no longer be optional.]
`<space_id>`::
(Optional, string) An identifier for the space. If it is not specified, the
default space is used.
=== Response code
`200`::
Indicates a successful call.
=== Example
Retrieves comment ID `71ec1870-725b-11ea-a0b2-c51ea50a58e2` from case ID
`a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`:
[source,sh]
--------------------------------------------------
GET api/cases/a18b38a0-71b0-11ea-a0b2-c51ea50a58e2/comments/71ec1870-725b-11ea-a0b2-c51ea50a58e2
--------------------------------------------------
// KIBANA
The API returns the requested comment JSON object. For example:
[source,json]
--------------------------------------------------
{
"id":"8acb3a80-ab0a-11ec-985f-97e55adae8b9",
"version":"Wzc5NzYsM10=",
"comment":"Start operation bubblegum immediately! And chew fast!",
"type":"user",
"owner":"cases",
"created_at":"2022-03-24T00:37:10.832Z",
"created_by": {
"email": "classified@hms.oo.gov.uk",
"full_name": "Classified",
"username": "M"
},
"pushed_at": null,
"pushed_by": null,
"updated_at": null,
"updated_by": null
}
--------------------------------------------------

View file

@ -156,8 +156,7 @@ and `open`.
(Optional, string) A title for the case.
`version`::
(Required, string) The current version of the case.
//To determine this value, use <<cases-api-get-case>> or <<cases-api-find-cases>>
(Required, string) The current version of the case. To determine this value, use <<cases-api-get-case>> or <<cases-api-find-cases>>.
====
=== Response code