mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
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> |
||
---|---|---|
.. | ||
alerting | ||
commands | ||
dashboard | ||
graph | ||
images | ||
introduction/images | ||
ml | ||
monitoring | ||
production-considerations | ||
reporting | ||
security | ||
troubleshooting | ||
api.asciidoc | ||
canvas.asciidoc | ||
dev-tools.asciidoc | ||
discover.asciidoc | ||
index.asciidoc | ||
introduction.asciidoc | ||
management.asciidoc | ||
plugins.asciidoc | ||
setup.asciidoc | ||
whats-new.asciidoc |