kibana/docs/user
Jonathan Buttner a78fece18b
[Cases] Adding _find API for user actions (#148861)
This PR adds a new find API for retrieving a subset of the user actions
for a case.

Issue: https://github.com/elastic/kibana/issues/134344

```
GET /api/cases/<case_id>/user_actions/_find
Query Paramaters
{
  types?: Array of "assignees" | "comment" | "connector" | "description" | "pushed" | "tags" | "title" | "status" | "settings" | "severity" | "create_case" | "delete_case" | "action" | "alert" | "user" | "attachment"
  sortOrder?: "asc" | "desc"
  page?: number as a string
  perPage?: number as a string
}
```

<details><summary>Example request and response</summary>

Request
```
curl --location --request GET 'http://localhost:5601/api/cases/8df5fe00-96b1-11ed-9341-471c9630b5ec/user_actions/_find?types=create_case&sortOrder=asc' \
--header 'kbn-xsrf: hello' \
--header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \
--data-raw ''
```


Response
```
{
    "userActions": [
        {
            "created_at": "2023-01-17T21:54:45.527Z",
            "created_by": {
                "username": "elastic",
                "full_name": null,
                "email": null,
                "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
            },
            "owner": "cases",
            "action": "create",
            "payload": {
                "title": "Awesome case",
                "tags": [],
                "severity": "low",
                "description": "super",
                "assignees": [],
                "connector": {
                    "name": "none",
                    "type": ".none",
                    "fields": null,
                    "id": "none"
                },
                "settings": {
                    "syncAlerts": false
                },
                "owner": "cases",
                "status": "open"
            },
            "type": "create_case",
            "id": "8e121180-96b1-11ed-9341-471c9630b5ec",
            "case_id": "8df5fe00-96b1-11ed-9341-471c9630b5ec",
            "comment_id": null
        }
    ],
    "page": 1,
    "perPage": 20,
    "total": 1
}
```

</details>

## Notable Changes
- Created the new `_find` route
- Created a new `UserActionFinder` class and moved the find* methods
from the `index.ts` file into there as well as the new find logic
- Extracted the transform logic to its own file since its shared between
multiple files now
- Extracted the user action related integration test functions to the
`user_action.ts` utility file

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
2023-01-23 13:25:41 -05:00
..
alerting [ResponseOps] Automate screenshots for new rule statuses (#147492) 2023-01-04 07:21:00 -05:00
commands [docs] Improve Secure saved objects and kibana-encryption-keys docs (#132828) 2022-05-25 06:27:37 +02:00
dashboard [Docs][Image Embeddable] Add user-facing docs for image panel (#148054) 2023-01-04 16:01:49 +01:00
graph [DOCS] Updates saved objects & other docs (#139328) 2022-09-21 16:11:41 -07:00
images [DOCS] Fix Rules and Connectors app labels (#145660) 2022-11-22 09:14:31 -08:00
introduction/images Doc changes for stack management and grouped feature privileges (#80486) 2020-10-27 11:41:31 -04:00
ml [DOCS] Adds log pattern analysis docs to AIOps Labs subsection (#141939) 2022-09-29 17:34:53 +02:00
monitoring [DOCS] Fix Rules and Connectors app labels (#145660) 2022-11-22 09:14:31 -08:00
production-considerations [DOCS] Fix Rules and Connectors app labels (#145660) 2022-11-22 09:14:31 -08:00
reporting [DOCS] Update 'xpack.screenshotting.browser.chromium.disableSandbox` documentation (#148425) 2023-01-10 09:26:57 -05:00
security [Cases] Adding _find API for user actions (#148861) 2023-01-23 13:25:41 -05:00
troubleshooting [DOCS] Fix links in Kibana troubleshooting (#144749) 2022-11-07 17:01:10 -08:00
api.asciidoc Append DevTool commands automatically prefix Space (#140443) 2022-10-18 14:18:36 -06:00
canvas.asciidoc [DOCS] Adds the 8.6 Presentation docs (#145474) 2022-11-28 11:20:38 -05:00
dev-tools.asciidoc [DOCS] Adds Kibana API support to Console (#134111) 2022-06-13 09:03:44 -07:00
discover.asciidoc [DOCS] Updates Discover docs for 8.5 (#142021) 2022-10-10 15:21:23 -07:00
index.asciidoc Document execution_context feature (#120894) 2021-12-16 17:13:55 +01:00
introduction.asciidoc [DOCS] Fix Rules and Connectors app labels (#145660) 2022-11-22 09:14:31 -08:00
management.asciidoc Updates upgrade assistant doclinks to point to current rather than hard-coded 7.17 (#147585) 2022-12-19 09:19:26 -07:00
plugins.asciidoc [External-plugins-list] Add Sankey Visualization (#137835) 2022-08-03 19:24:17 -04:00
setup.asciidoc [DOCS] Add kibana-verification-tool and CLI main page (#120836) 2021-12-09 11:57:25 -05:00
whats-new.asciidoc [DOCS] Updates what's new pages (#147483) 2022-12-14 07:36:12 -08:00