From d5565a3699827b76dc390aa6fa6048a406f3f98b Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 18 Oct 2023 14:16:20 -0700 Subject: [PATCH 1/6] [OAS] Add customFields to get case configure; remove redundant servers --- .../plugins/cases/docs/openapi/bundled.json | 725 +++++++----------- .../plugins/cases/docs/openapi/bundled.yaml | 329 ++++---- .../get_case_configuration_response.yaml | 25 + .../case_configure_response_properties.yaml | 21 + .../schemas/custom_fields_property.yaml | 6 +- .../cases/docs/openapi/entrypoint.yaml | 6 +- .../cases/docs/openapi/paths/api@cases.yaml | 11 +- .../docs/openapi/paths/api@cases@_find.yaml | 4 - .../paths/api@cases@alerts@{alertid}.yaml | 6 +- .../openapi/paths/api@cases@configure.yaml | 11 +- .../api@cases@configure@connectors@_find.yaml | 4 - ...api@cases@configure@{configurationid}.yaml | 6 +- .../openapi/paths/api@cases@reporters.yaml | 6 +- .../docs/openapi/paths/api@cases@status.yaml | 4 - .../docs/openapi/paths/api@cases@tags.yaml | 6 +- .../openapi/paths/api@cases@{caseid}.yaml | 6 +- .../paths/api@cases@{caseid}@alerts.yaml | 6 +- .../paths/api@cases@{caseid}@comments.yaml | 11 - ...i@cases@{caseid}@comments@{commentid}.yaml | 8 +- ...caseid}@connector@{connectorid}@_push.yaml | 6 +- .../api@cases@{caseid}@user_actions.yaml | 4 - ...api@cases@{caseid}@user_actions@_find.yaml | 4 - .../openapi/paths/s@{spaceid}@api@cases.yaml | 9 - .../paths/s@{spaceid}@api@cases@_find.yaml | 4 - ...@{spaceid}@api@cases@alerts@{alertid}.yaml | 6 +- .../s@{spaceid}@api@cases@configure.yaml | 9 +- ...@api@cases@configure@connectors@_find.yaml | 4 - ...api@cases@configure@{configurationid}.yaml | 4 - .../s@{spaceid}@api@cases@reporters.yaml | 4 - .../paths/s@{spaceid}@api@cases@status.yaml | 5 +- .../paths/s@{spaceid}@api@cases@tags.yaml | 4 - .../paths/s@{spaceid}@api@cases@{caseid}.yaml | 4 - ...s@{spaceid}@api@cases@{caseid}@alerts.yaml | 4 - ...{spaceid}@api@cases@{caseid}@comments.yaml | 11 - ...id}@api@cases@{caseid}@comments@_find.yaml | 5 - ...i@cases@{caseid}@comments@{commentid}.yaml | 8 +- ...caseid}@connector@{connectorid}@_push.yaml | 4 - ...ceid}@api@cases@{caseid}@user_actions.yaml | 6 +- ...api@cases@{caseid}@user_actions@_find.yaml | 4 - 39 files changed, 513 insertions(+), 797 deletions(-) create mode 100644 x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml diff --git a/x-pack/plugins/cases/docs/openapi/bundled.json b/x-pack/plugins/cases/docs/openapi/bundled.json index 9ef79cb9203ed4..0762f16293b917 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.json +++ b/x-pack/plugins/cases/docs/openapi/bundled.json @@ -14,8 +14,12 @@ }, "servers": [ { - "url": "http://localhost:5601", - "description": "local" + "url": "https://{kibanaUrl}", + "variables": { + "kibanaUrl": { + "default": "localhost:5601" + } + } } ], "security": [ @@ -87,12 +91,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "delete": { "summary": "Deletes one or more cases in the default space.", @@ -123,12 +122,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "patch": { "summary": "Updates one or more cases in the default space.", @@ -185,18 +179,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/_find": { "get": { @@ -309,18 +293,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/alerts/{alertId}": { "get": { @@ -380,18 +354,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601s" } - ] + } }, "/api/cases/configure": { "get": { @@ -419,6 +383,35 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, + "customFields": { + "type": "array", + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "key": { + "description": "The key identifying the custom field.", + "type": "string" + }, + "label": { + "description": "The custom field label.", + "type": "string" + }, + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "connector": { "type": "object", "properties": { @@ -540,6 +533,11 @@ } } } + }, + "examples": { + "getConfigurationResponse": { + "$ref": "#/components/examples/get_case_configuration_response" + } } } } @@ -554,12 +552,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "post": { "summary": "Sets external connection details, such as the closure type and default connector for cases in the default space.", @@ -598,6 +591,35 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, + "customFields": { + "type": "array", + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "key": { + "description": "The key identifying the custom field.", + "type": "string" + }, + "label": { + "description": "The custom field label.", + "type": "string" + }, + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "connector": { "type": "object", "properties": { @@ -737,18 +759,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/configure/{configurationId}": { "patch": { @@ -788,6 +800,35 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, + "customFields": { + "type": "array", + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "key": { + "description": "The key identifying the custom field.", + "type": "string" + }, + "label": { + "description": "The custom field label.", + "type": "string" + }, + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "connector": { "type": "object", "properties": { @@ -923,18 +964,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/reporters": { "get": { @@ -1000,18 +1031,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/status": { "get": { @@ -1064,18 +1085,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/tags": { "get": { @@ -1120,18 +1131,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/{caseId}": { "get": { @@ -1175,18 +1176,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/{caseId}/alerts": { "get": { @@ -1231,18 +1222,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/{caseId}/comments": { "post": { @@ -1301,12 +1282,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "delete": { "summary": "Deletes all comments and alerts from a case in the default space.", @@ -1337,12 +1313,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "patch": { "summary": "Updates a comment or alert in a case in the default space.", @@ -1400,12 +1371,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "get": { "summary": "Retrieves all the comments from a case in the default space.", @@ -1441,18 +1407,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/{caseId}/comments/{commentId}": { "delete": { @@ -1487,12 +1443,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "get": { "summary": "Retrieves a comment from a case in the default space.", @@ -1542,18 +1493,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/{caseId}/connector/{connectorId}/_push": { "post": { @@ -1610,18 +1551,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/{caseId}/user_actions": { "get": { @@ -1666,18 +1597,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/{caseId}/user_actions/_find": { "get": { @@ -1748,18 +1669,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/api/cases/configure/connectors/_find": { "get": { @@ -1834,18 +1745,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases": { "post": { @@ -1904,12 +1805,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "delete": { "summary": "Deletes one or more cases.", @@ -1943,12 +1839,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "patch": { "summary": "Updates one or more cases.", @@ -2008,18 +1899,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/_find": { "get": { @@ -2134,18 +2015,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/alerts/{alertId}": { "get": { @@ -2207,18 +2078,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/configure": { "get": { @@ -2249,6 +2110,35 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, + "customFields": { + "type": "array", + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "key": { + "description": "The key identifying the custom field.", + "type": "string" + }, + "label": { + "description": "The custom field label.", + "type": "string" + }, + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "connector": { "type": "object", "properties": { @@ -2370,6 +2260,11 @@ } } } + }, + "examples": { + "getConfigurationResponse": { + "$ref": "#/components/examples/get_case_configuration_response" + } } } } @@ -2384,12 +2279,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "post": { "summary": "Sets external connection details, such as the closure type and default connector for cases.", @@ -2431,6 +2321,35 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, + "customFields": { + "type": "array", + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "key": { + "description": "The key identifying the custom field.", + "type": "string" + }, + "label": { + "description": "The custom field label.", + "type": "string" + }, + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "connector": { "type": "object", "properties": { @@ -2570,18 +2489,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/configure/{configurationId}": { "patch": { @@ -2624,6 +2533,35 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, + "customFields": { + "type": "array", + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "key": { + "description": "The key identifying the custom field.", + "type": "string" + }, + "label": { + "description": "The custom field label.", + "type": "string" + }, + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "connector": { "type": "object", "properties": { @@ -2759,18 +2697,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/configure/connectors/_find": { "get": { @@ -2849,18 +2777,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/reporters": { "get": { @@ -2928,18 +2846,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/status": { "get": { @@ -2995,18 +2903,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/tags": { "get": { @@ -3053,18 +2951,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/{caseId}": { "get": { @@ -3111,18 +2999,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/{caseId}/alerts": { "get": { @@ -3170,18 +3048,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/{caseId}/comments": { "post": { @@ -3243,12 +3111,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "delete": { "summary": "Deletes all comments and alerts from a case.", @@ -3282,12 +3145,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "patch": { "summary": "Updates a comment or alert in a case.", @@ -3348,12 +3206,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "get": { "summary": "Retrieves all the comments from a case.", @@ -3392,18 +3245,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/{caseId}/comments/_find": { "get": { @@ -3451,18 +3294,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/{caseId}/comments/{commentId}": { "delete": { @@ -3500,12 +3333,7 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] + } }, "get": { "summary": "Retrieves a comment from a case.", @@ -3558,18 +3386,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/{caseId}/connector/{connectorId}/_push": { "post": { @@ -3629,18 +3447,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/{caseId}/user_actions": { "get": { @@ -3688,18 +3496,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } }, "/s/{spaceId}/api/cases/{caseId}/user_actions/_find": { "get": { @@ -3773,18 +3571,8 @@ } } } - }, - "servers": [ - { - "url": "https://localhost:5601" - } - ] - }, - "servers": [ - { - "url": "https://localhost:5601" } - ] + } } }, "components": { @@ -4581,7 +4369,7 @@ }, "custom_fields_property": { "type": "array", - "description": "Values for custom fields of a case", + "description": "Values for custom fields of a case.", "minItems": 0, "maxItems": 5, "items": { @@ -4597,7 +4385,7 @@ "type": "string" }, "type": { - "description": "The type of the custom field. Should match the key and how the custom field was configured", + "description": "The type of the custom field. It should match the key and how the custom field was configured.\n", "type": "string" }, "field": { @@ -6621,6 +6409,41 @@ "count_closed_cases": 0 } }, + "get_case_configuration_response": { + "summary": "Get the case configuration.", + "value": [ + { + "id": "856ee650-6c82-11ee-a20a-6164169afa58", + "closure_type": "close-by-user", + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "label": "my-field", + "required": false, + "type": "text" + } + ], + "owner": "cases", + "created_at": "2023-06-01T17:07:17.767Z", + "created_by": { + "username": "elastic", + "email": null, + "full_name": null + }, + "updated_at": null, + "updated_by": null, + "connector": { + "id": "none", + "name": "none", + "type": ".none", + "fields": null + }, + "mappings": [], + "version": "WzUxLDRd", + "error": null + } + ] + }, "set_case_configuration_request": { "summary": "Set the closure type and default connector for Stack Management cases.", "value": { diff --git a/x-pack/plugins/cases/docs/openapi/bundled.yaml b/x-pack/plugins/cases/docs/openapi/bundled.yaml index c24f9f3c67fa37..2f5b763484bdf0 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.yaml +++ b/x-pack/plugins/cases/docs/openapi/bundled.yaml @@ -9,8 +9,10 @@ info: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license servers: - - url: http://localhost:5601 - description: local + - url: https://{kibanaUrl} + variables: + kibanaUrl: + default: localhost:5601 security: - basicAuth: [] - apiKeyAuth: [] @@ -53,8 +55,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 delete: summary: Deletes one or more cases in the default space. operationId: deleteCaseDefaultSpace @@ -74,8 +74,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 patch: summary: Updates one or more cases in the default space. operationId: updateCaseDefaultSpace @@ -111,10 +109,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/_find: get: summary: Retrieves a paginated subset of cases in the default space. @@ -174,10 +168,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/alerts/{alertId}: get: summary: Returns the cases associated with a specific alert in the default space. @@ -216,10 +206,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601s /api/cases/configure: get: summary: Retrieves external connection details, such as the closure type and default connector for cases in the default space. @@ -242,6 +228,27 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + key: + description: The key identifying the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle connector: type: object properties: @@ -331,14 +338,15 @@ paths: version: type: string example: WzIwNzMsMV0= + examples: + getConfigurationResponse: + $ref: '#/components/examples/get_case_configuration_response' '401': description: Authorization information is missing or invalid. content: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 post: summary: Sets external connection details, such as the closure type and default connector for cases in the default space. operationId: setCaseConfigurationDefaultSpace @@ -366,6 +374,27 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + key: + description: The key identifying the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle connector: type: object properties: @@ -464,10 +493,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/configure/{configurationId}: patch: summary: Updates external connection details, such as the closure type and default connector for cases in the default space. @@ -496,6 +521,27 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + key: + description: The key identifying the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle connector: type: object properties: @@ -591,10 +637,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/reporters: get: summary: Returns information about the users who opened cases in the default space. @@ -640,10 +682,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/status: get: summary: Returns the number of cases that are open, closed, and in progress in the default space. @@ -678,10 +716,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/tags: get: summary: Aggregates and returns a list of case tags in the default space. @@ -711,10 +745,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/{caseId}: get: summary: Retrieves information about a case in the default space. @@ -742,10 +772,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/{caseId}/alerts: get: summary: Gets all alerts attached to a case in the default space. @@ -775,10 +801,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/{caseId}/comments: post: summary: Adds a comment or alert to a case in the default space. @@ -815,8 +837,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 delete: summary: Deletes all comments and alerts from a case in the default space. operationId: deleteCaseCommentsDefaultSpace @@ -836,8 +856,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 patch: summary: Updates a comment or alert in a case in the default space. operationId: updateCaseCommentDefaultSpace @@ -873,8 +891,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 get: summary: Retrieves all the comments from a case in the default space. operationId: getAllCaseCommentsDefaultSpace @@ -898,10 +914,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/{caseId}/comments/{commentId}: delete: summary: Deletes a comment or alert from a case in the default space. @@ -923,8 +935,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 get: summary: Retrieves a comment from a case in the default space. operationId: getCaseCommentDefaultSpace @@ -953,10 +963,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/{caseId}/connector/{connectorId}/_push: post: summary: Pushes a case in the default space to an external service. @@ -991,10 +997,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/{caseId}/user_actions: get: summary: Returns all user activity for a case in the default space. @@ -1024,10 +1026,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/{caseId}/user_actions/_find: get: summary: Finds user activity for a case in the default space. @@ -1070,10 +1068,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /api/cases/configure/connectors/_find: get: summary: Retrieves information about connectors in the default space. @@ -1124,10 +1118,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases: post: summary: Creates a case. @@ -1164,8 +1154,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 delete: summary: Deletes one or more cases. operationId: deleteCase @@ -1186,8 +1174,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 patch: summary: Updates one or more cases. operationId: updateCase @@ -1224,10 +1210,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/_find: get: summary: Retrieves a paginated subset of cases. @@ -1287,10 +1269,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/alerts/{alertId}: get: summary: Returns the cases associated with a specific alert. @@ -1329,10 +1307,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/configure: get: summary: Retrieves external connection details, such as the closure type and default connector for cases. @@ -1356,6 +1330,27 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + key: + description: The key identifying the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle connector: type: object properties: @@ -1445,14 +1440,15 @@ paths: version: type: string example: WzIwNzMsMV0= + examples: + getConfigurationResponse: + $ref: '#/components/examples/get_case_configuration_response' '401': description: Authorization information is missing or invalid. content: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 post: summary: Sets external connection details, such as the closure type and default connector for cases. operationId: setCaseConfiguration @@ -1481,6 +1477,27 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + key: + description: The key identifying the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle connector: type: object properties: @@ -1579,10 +1596,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/configure/{configurationId}: patch: summary: Updates external connection details, such as the closure type and default connector for cases. @@ -1612,6 +1625,27 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + key: + description: The key identifying the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle connector: type: object properties: @@ -1707,10 +1741,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/configure/connectors/_find: get: summary: Retrieves information about connectors. @@ -1762,10 +1792,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/reporters: get: summary: Returns information about the users who opened cases. @@ -1811,10 +1837,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/status: get: summary: Returns the number of cases that are open, closed, and in progress. @@ -1850,10 +1872,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/tags: get: summary: Aggregates and returns a list of case tags. @@ -1883,10 +1901,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}: get: summary: Retrieves information about a case. @@ -1915,10 +1929,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/alerts: get: summary: Gets all alerts attached to a case. @@ -1949,10 +1959,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/comments: post: summary: Adds a comment or alert to a case. @@ -1990,8 +1996,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 delete: summary: Deletes all comments and alerts from a case. operationId: deleteCaseComments @@ -2012,8 +2016,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 patch: summary: Updates a comment or alert in a case. operationId: updateCaseComment @@ -2050,8 +2052,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 get: summary: Retrieves all the comments from a case. operationId: getAllCaseComments @@ -2076,10 +2076,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/comments/_find: get: summary: Retrieves all the user comments from a case. @@ -2107,10 +2103,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/comments/{commentId}: delete: summary: Deletes a comment or alert from a case. @@ -2133,8 +2125,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 get: summary: Retrieves a comment from a case. operationId: getCaseComment @@ -2164,10 +2154,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/connector/{connectorId}/_push: post: summary: Pushes a case to an external service. @@ -2203,10 +2189,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/user_actions: get: summary: Returns all user activity for a case. @@ -2237,10 +2219,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 /s/{spaceId}/api/cases/{caseId}/user_actions/_find: get: summary: Finds user activity for a case. @@ -2284,10 +2262,6 @@ paths: application/json: schema: $ref: '#/components/schemas/4xx_response' - servers: - - url: https://localhost:5601 - servers: - - url: https://localhost:5601 components: securitySchemes: basicAuth: @@ -2892,7 +2866,7 @@ components: default: low custom_fields_property: type: array - description: Values for custom fields of a case + description: Values for custom fields of a case. minItems: 0 maxItems: 5 items: @@ -2906,7 +2880,8 @@ components: description: The key identifying the custom field. type: string type: - description: The type of the custom field. Should match the key and how the custom field was configured + description: | + The type of the custom field. It should match the key and how the custom field was configured. type: string field: description: An object containing the value of the field. @@ -4345,6 +4320,32 @@ components: count_open_cases: 1 count_in_progress_cases: 0 count_closed_cases: 0 + get_case_configuration_response: + summary: Get the case configuration. + value: + - id: 856ee650-6c82-11ee-a20a-6164169afa58 + closure_type: close-by-user + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-field + required: false + type: text + owner: cases + created_at: '2023-06-01T17:07:17.767Z' + created_by: + username: elastic + email: null + full_name: null + updated_at: null + updated_by: null + connector: + id: none + name: none + type: .none + fields: null + mappings: [] + version: WzUxLDRd + error: null set_case_configuration_request: summary: Set the closure type and default connector for Stack Management cases. value: diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml new file mode 100644 index 00000000000000..f9ba65bd5f7978 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml @@ -0,0 +1,25 @@ +summary: Get the case configuration. +value: + - id: 856ee650-6c82-11ee-a20a-6164169afa58 + closure_type: close-by-user + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-field + required: false + type: text + owner: cases + created_at: 2023-06-01T17:07:17.767Z + created_by: + username: elastic + email: null + full_name: null + updated_at: null + updated_by: null + connector: + id: none + name: none + type: .none + fields: null + mappings: [] + version: WzUxLDRd + error: null diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml index 90c969990f2e5f..5fbf57023706e6 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml @@ -1,5 +1,26 @@ closure_type: $ref: 'closure_types.yaml' +customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + key: + description: The key identifying the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle connector: type: object properties: diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml index 2b682960bd1f0e..2dc861aa13e1c3 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml @@ -1,5 +1,5 @@ type: array -description: Values for custom fields of a case +description: Values for custom fields of a case. minItems: 0 maxItems: 5 items: @@ -13,7 +13,9 @@ items: description: The key identifying the custom field. type: string type: - description: The type of the custom field. Should match the key and how the custom field was configured + description: > + The type of the custom field. + It should match the key and how the custom field was configured. type: string field: description: An object containing the value of the field. diff --git a/x-pack/plugins/cases/docs/openapi/entrypoint.yaml b/x-pack/plugins/cases/docs/openapi/entrypoint.yaml index 142dcd2706fd38..fed1e2011b38fc 100644 --- a/x-pack/plugins/cases/docs/openapi/entrypoint.yaml +++ b/x-pack/plugins/cases/docs/openapi/entrypoint.yaml @@ -12,8 +12,10 @@ tags: - name: cases description: Case APIs enable you to open and track issues. servers: - - url: 'http://localhost:5601' - description: local + - url: https://{kibanaUrl} + variables: + kibanaUrl: + default: localhost:5601 paths: # Paths in the default space '/api/cases': diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases.yaml index 98e97b6af7d5bb..f92df59625dc27 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases.yaml @@ -34,9 +34,7 @@ post: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 - + delete: summary: Deletes one or more cases in the default space. operationId: deleteCaseDefaultSpace @@ -59,8 +57,6 @@ delete: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 patch: summary: Updates one or more cases in the default space. @@ -99,8 +95,3 @@ patch: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 - -servers: - - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@_find.yaml index 6fd7f65ced3ad6..aa926636802a28 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@_find.yaml @@ -58,7 +58,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@alerts@{alertid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@alerts@{alertid}.yaml index 24e91369a6422a..64ff49d17b8cd1 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@alerts@{alertid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@alerts@{alertid}.yaml @@ -36,8 +36,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601s \ No newline at end of file + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml index ebbae5e333103c..e457a6239a9c2a 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml @@ -20,14 +20,15 @@ get: type: object properties: $ref: '../components/schemas/case_configure_response_properties.yaml' + examples: + getConfigurationResponse: + $ref: '../components/examples/get_case_configuration_response.yaml' '401': description: Authorization information is missing or invalid. content: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 post: summary: Sets external connection details, such as the closure type and default connector for cases in the default space. @@ -67,8 +68,4 @@ post: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@connectors@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@connectors@_find.yaml index b0b3111094218f..53a5ebf537e576 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@connectors@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@connectors@_find.yaml @@ -28,7 +28,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml index 507842e6f47f44..63e10fc5624248 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml @@ -32,8 +32,4 @@ patch: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@reporters.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@reporters.yaml index 7bf256e3c33a35..8fd5e9a916ea9c 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@reporters.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@reporters.yaml @@ -29,8 +29,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@status.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@status.yaml index 17dedefd164506..ab6cde8d05475c 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@status.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@status.yaml @@ -34,7 +34,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@tags.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@tags.yaml index 3ce4e0578178e9..5f0083d087b5c9 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@tags.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@tags.yaml @@ -25,8 +25,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}.yaml index 48238dcdcf4de8..9629049c9b3428 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}.yaml @@ -25,8 +25,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@alerts.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@alerts.yaml index 80e40933031369..525fb25f4b6d58 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@alerts.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@alerts.yaml @@ -27,8 +27,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@comments.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@comments.yaml index 160a5a5f221ca5..fa25d6263143df 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@comments.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@comments.yaml @@ -36,8 +36,6 @@ post: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 delete: summary: Deletes all comments and alerts from a case in the default space. @@ -60,8 +58,6 @@ delete: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 patch: summary: Updates a comment or alert in a case in the default space. @@ -101,8 +97,6 @@ patch: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 get: summary: Retrieves all the comments from a case in the default space. @@ -131,8 +125,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 - -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml index 0eb35a7bb1c9af..354b0082014060 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@comments@{commentid}.yaml @@ -20,8 +20,6 @@ delete: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 get: summary: Retrieves a comment from a case in the default space. @@ -52,8 +50,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml index 4731c69bab76a2..321f2f6938c508 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@connector@{connectorid}@_push.yaml @@ -31,8 +31,4 @@ post: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions.yaml index b0e38a119fd34e..9bb67097e62e01 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions.yaml @@ -29,7 +29,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions@_find.yaml index ab8c16a641fdcb..99caec414b1324 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions@_find.yaml @@ -41,7 +41,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases.yaml index 58e73f6a68d171..1703dc5eecdc59 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases.yaml @@ -35,8 +35,6 @@ post: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 delete: summary: Deletes one or more cases. @@ -61,8 +59,6 @@ delete: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 patch: summary: Updates one or more cases. @@ -102,8 +98,3 @@ patch: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 - -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@_find.yaml index fa9687b439f84b..a688b10389ecd4 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@_find.yaml @@ -58,7 +58,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml index 940f343c893868..f1e287e05d304c 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@alerts@{alertid}.yaml @@ -36,8 +36,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml index c991005af9d700..8844e0a53a960e 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml @@ -21,14 +21,15 @@ get: type: object properties: $ref: '../components/schemas/case_configure_response_properties.yaml' + examples: + getConfigurationResponse: + $ref: '../components/examples/get_case_configuration_response.yaml' '401': description: Authorization information is missing or invalid. content: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 post: summary: Sets external connection details, such as the closure type and default connector for cases. @@ -73,7 +74,3 @@ post: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml index bfe60072b8f50a..f04f802ba3245f 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml @@ -29,7 +29,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml index 749f1ece724b25..a874c54564313b 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml @@ -35,7 +35,3 @@ patch: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@reporters.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@reporters.yaml index 51e57615f12164..734ed5fac049a7 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@reporters.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@reporters.yaml @@ -34,7 +34,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@status.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@status.yaml index d3c4b40fa3aea9..90c5747f278b8b 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@status.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@status.yaml @@ -35,7 +35,4 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 + diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@tags.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@tags.yaml index ff448041dd712a..88025633b12d1b 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@tags.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@tags.yaml @@ -28,7 +28,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml index fb4f735f322eb7..32e3434f15adda 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}.yaml @@ -27,7 +27,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml index aca587fe4886c7..7784c49bf9ca0c 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@alerts.yaml @@ -29,7 +29,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml index 1e1c73838abb9b..0551151b613f1d 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments.yaml @@ -37,8 +37,6 @@ post: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 delete: summary: Deletes all comments and alerts from a case. @@ -62,8 +60,6 @@ delete: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 patch: summary: Updates a comment or alert in a case. @@ -104,8 +100,6 @@ patch: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 get: summary: Retrieves all the comments from a case. @@ -135,8 +129,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 - -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@_find.yaml index b1dd32a6595153..b027660aaf1eae 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@_find.yaml @@ -26,8 +26,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 - -servers: - - url: https://localhost:5601 diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml index e43a2b2d81d65b..2db1929ae43734 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@comments@{commentid}.yaml @@ -21,8 +21,6 @@ delete: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 get: summary: Retrieves a comment from a case. @@ -54,8 +52,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml index c378192592ce94..bee91522dde299 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@connector@{connectorid}@_push.yaml @@ -36,7 +36,3 @@ post: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml index 4aa52bdbc44b55..6ec289c15cc66d 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml @@ -29,8 +29,4 @@ get: content: application/json: schema: - $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 + $ref: '../components/schemas/4xx_response.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions@_find.yaml index 61a1290c7c5a6f..0b5a6e660da8b9 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions@_find.yaml @@ -42,7 +42,3 @@ get: application/json: schema: $ref: '../components/schemas/4xx_response.yaml' - servers: - - url: https://localhost:5601 -servers: - - url: https://localhost:5601 From e1d8f36b5fc13e834ff45c904386180d072a8c64 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 18 Oct 2023 16:41:46 -0700 Subject: [PATCH 2/6] [OAS] Add more missing customFields --- .../plugins/cases/docs/openapi/bundled.json | 72 ++++++++++++++----- .../plugins/cases/docs/openapi/bundled.yaml | 55 ++++++++++---- .../set_case_configuration_response.yaml | 3 +- .../case_configure_response_properties.yaml | 1 + .../configure_custom_fields_request.yaml | 26 +++++++ .../schemas/custom_fields_property.yaml | 1 + .../set_case_configuration_request.yaml | 12 +--- .../update_case_configuration_request.yaml | 2 + .../schemas/update_case_request.yaml | 4 +- 9 files changed, 132 insertions(+), 44 deletions(-) create mode 100644 x-pack/plugins/cases/docs/openapi/components/schemas/configure_custom_fields_request.yaml diff --git a/x-pack/plugins/cases/docs/openapi/bundled.json b/x-pack/plugins/cases/docs/openapi/bundled.json index 0762f16293b917..498e225a9f5245 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.json +++ b/x-pack/plugins/cases/docs/openapi/bundled.json @@ -385,6 +385,7 @@ }, "customFields": { "type": "array", + "x-technical-preview": true, "description": "Custom fields configuration details.", "items": { "type": "object", @@ -593,6 +594,7 @@ }, "customFields": { "type": "array", + "x-technical-preview": true, "description": "Custom fields configuration details.", "items": { "type": "object", @@ -802,6 +804,7 @@ }, "customFields": { "type": "array", + "x-technical-preview": true, "description": "Custom fields configuration details.", "items": { "type": "object", @@ -2112,6 +2115,7 @@ }, "customFields": { "type": "array", + "x-technical-preview": true, "description": "Custom fields configuration details.", "items": { "type": "object", @@ -2323,6 +2327,7 @@ }, "customFields": { "type": "array", + "x-technical-preview": true, "description": "Custom fields configuration details.", "items": { "type": "object", @@ -2535,6 +2540,7 @@ }, "customFields": { "type": "array", + "x-technical-preview": true, "description": "Custom fields configuration details.", "items": { "type": "object", @@ -4370,6 +4376,7 @@ "custom_fields_property": { "type": "array", "description": "Values for custom fields of a case.", + "x-technical-preview": true, "minItems": 0, "maxItems": 5, "items": { @@ -5095,6 +5102,9 @@ } ] }, + "customFields": { + "$ref": "#/components/schemas/custom_fields_property" + }, "description": { "description": "An updated description for the case.", "type": "string" @@ -5135,9 +5145,6 @@ "version": { "description": "The current version of the case. To determine this value, use the get case or find cases APIs.", "type": "string" - }, - "customFields": { - "$ref": "#/components/schemas/custom_fields_property" } } } @@ -5175,6 +5182,42 @@ ], "example": ".none" }, + "configure_custom_fields_request": { + "type": "array", + "description": "Custom fields case configuration.", + "x-technical-preview": true, + "items": { + "type": "object", + "required": [ + "key", + "label", + "required", + "type" + ], + "properties": { + "key": { + "description": "A unique key for the custom field.", + "type": "string" + }, + "label": { + "description": "The custom field label.", + "type": "string" + }, + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "set_case_configuration_request": { "title": "Set case configuration request", "description": "External connection details, such as the closure type and default connector for cases.", @@ -5218,22 +5261,11 @@ "type" ] }, + "customFields": { + "$ref": "#/components/schemas/configure_custom_fields_request" + }, "owner": { "$ref": "#/components/schemas/owners" - }, - "settings": { - "description": "An object that contains the case settings.", - "type": "object", - "properties": { - "syncAlerts": { - "description": "Turns alert syncing on or off.", - "type": "boolean", - "example": true - } - }, - "required": [ - "syncAlerts" - ] } } }, @@ -5278,6 +5310,9 @@ "type" ] }, + "customFields": { + "$ref": "#/components/schemas/configure_custom_fields_request" + }, "version": { "description": "The version of the connector. To retrieve the version value, use the get configuration API.\n", "type": "string", @@ -6461,8 +6496,9 @@ "summary": "This is an example response when the case configuration was updated.", "value": { "closure_type": "close-by-user", + "customFields": [], "owner": "cases", - "created_at": "2022-06-01T17:07:17.767Z", + "created_at": "2023-10-01T17:07:17.767Z", "created_by": { "username": "elastic", "email": "null,", diff --git a/x-pack/plugins/cases/docs/openapi/bundled.yaml b/x-pack/plugins/cases/docs/openapi/bundled.yaml index 2f5b763484bdf0..20aa0bf4a98d27 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.yaml +++ b/x-pack/plugins/cases/docs/openapi/bundled.yaml @@ -230,6 +230,7 @@ paths: $ref: '#/components/schemas/closure_types' customFields: type: array + x-technical-preview: true description: Custom fields configuration details. items: type: object @@ -376,6 +377,7 @@ paths: $ref: '#/components/schemas/closure_types' customFields: type: array + x-technical-preview: true description: Custom fields configuration details. items: type: object @@ -523,6 +525,7 @@ paths: $ref: '#/components/schemas/closure_types' customFields: type: array + x-technical-preview: true description: Custom fields configuration details. items: type: object @@ -1332,6 +1335,7 @@ paths: $ref: '#/components/schemas/closure_types' customFields: type: array + x-technical-preview: true description: Custom fields configuration details. items: type: object @@ -1479,6 +1483,7 @@ paths: $ref: '#/components/schemas/closure_types' customFields: type: array + x-technical-preview: true description: Custom fields configuration details. items: type: object @@ -1627,6 +1632,7 @@ paths: $ref: '#/components/schemas/closure_types' customFields: type: array + x-technical-preview: true description: Custom fields configuration details. items: type: object @@ -2867,6 +2873,7 @@ components: custom_fields_property: type: array description: Values for custom fields of a case. + x-technical-preview: true minItems: 0 maxItems: 5 items: @@ -3381,6 +3388,8 @@ components: - $ref: '#/components/schemas/connector_properties_servicenow' - $ref: '#/components/schemas/connector_properties_servicenow_sir' - $ref: '#/components/schemas/connector_properties_swimlane' + customFields: + $ref: '#/components/schemas/custom_fields_property' description: description: An updated description for the case. type: string @@ -3412,8 +3421,6 @@ components: version: description: The current version of the case. To determine this value, use the get case or find cases APIs. type: string - customFields: - $ref: '#/components/schemas/custom_fields_property' searchFieldsType: type: string description: The fields to perform the `simple_query_string` parsed query against. @@ -3439,6 +3446,33 @@ components: - .servicenow-sir - .swimlane example: .none + configure_custom_fields_request: + type: array + description: Custom fields case configuration. + x-technical-preview: true + items: + type: object + required: + - key + - label + - required + - type + properties: + key: + description: A unique key for the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle set_case_configuration_request: title: Set case configuration request description: External connection details, such as the closure type and default connector for cases. @@ -3473,18 +3507,10 @@ components: - id - name - type + customFields: + $ref: '#/components/schemas/configure_custom_fields_request' owner: $ref: '#/components/schemas/owners' - settings: - description: An object that contains the case settings. - type: object - properties: - syncAlerts: - description: Turns alert syncing on or off. - type: boolean - example: true - required: - - syncAlerts update_case_configuration_request: title: Update case configuration request description: External connection details, such as the closure type and default connector for cases. @@ -3517,6 +3543,8 @@ components: - id - name - type + customFields: + $ref: '#/components/schemas/configure_custom_fields_request' version: description: | The version of the connector. To retrieve the version value, use the get configuration API. @@ -4360,8 +4388,9 @@ components: summary: This is an example response when the case configuration was updated. value: closure_type: close-by-user + customFields: [] owner: cases - created_at: '2022-06-01T17:07:17.767Z' + created_at: '2023-10-01T17:07:17.767Z' created_by: username: elastic email: null, diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml index 9290e1ed432685..ceea5eb533e73d 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml @@ -1,8 +1,9 @@ summary: This is an example response when the case configuration was updated. value: closure_type: close-by-user + customFields: [] owner: cases - created_at: 2022-06-01T17:07:17.767Z + created_at: 2023-10-01T17:07:17.767Z created_by: username: elastic email: null, diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml index 5fbf57023706e6..90604278c38a9b 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml @@ -2,6 +2,7 @@ closure_type: $ref: 'closure_types.yaml' customFields: type: array + x-technical-preview: true description: Custom fields configuration details. items: type: object diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/configure_custom_fields_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/configure_custom_fields_request.yaml new file mode 100644 index 00000000000000..80eb2a58ad37d8 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/configure_custom_fields_request.yaml @@ -0,0 +1,26 @@ +type: array +description: Custom fields case configuration. +x-technical-preview: true +items: + type: object + required: + - key + - label + - required + - type + properties: + key: + description: A unique key for the custom field. + type: string + label: + description: The custom field label. + type: string + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml index 2dc861aa13e1c3..bc26e871a799da 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml @@ -1,5 +1,6 @@ type: array description: Values for custom fields of a case. +x-technical-preview: true minItems: 0 maxItems: 5 items: diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml index 44a3a8709a9399..170f3a1591473a 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml @@ -18,15 +18,7 @@ properties: - id - name - type + customFields: + $ref: 'configure_custom_fields_request.yaml' owner: $ref: 'owners.yaml' - settings: - description: An object that contains the case settings. - type: object - properties: - syncAlerts: - description: Turns alert syncing on or off. - type: boolean - example: true - required: - - syncAlerts diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml index 89c03715944c47..70835fe4dec174 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml @@ -16,6 +16,8 @@ properties: - id - name - type + customFields: + $ref: 'configure_custom_fields_request.yaml' version: description: > The version of the connector. diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml index 4bbac95630e47d..23f9636ef20900 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml @@ -27,6 +27,8 @@ properties: - $ref: 'connector_properties_servicenow.yaml' - $ref: 'connector_properties_servicenow_sir.yaml' - $ref: 'connector_properties_swimlane.yaml' + customFields: + $ref: 'custom_fields_property.yaml' description: description: An updated description for the case. type: string @@ -58,5 +60,3 @@ properties: version: description: The current version of the case. To determine this value, use the get case or find cases APIs. type: string - customFields: - $ref: 'custom_fields_property.yaml' From 39d016b0a1f1ada73245ce5b1067a390c1e62491 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 18 Oct 2023 20:25:56 -0700 Subject: [PATCH 3/6] [OAS] Fix case API examples --- .../plugins/cases/docs/openapi/bundled.json | 1273 +++++++++-------- .../plugins/cases/docs/openapi/bundled.yaml | 816 ++++++----- .../examples/add_comment_response.yaml | 13 +- .../examples/create_case_request.yaml | 9 +- .../examples/create_case_response.yaml | 14 +- .../examples/find_case_activity_response.yaml | 31 +- .../examples/find_case_response.yaml | 23 +- .../examples/get_case_activity_response.yaml | 72 - .../get_case_configuration_response.yaml | 2 +- .../examples/get_case_response.yaml | 36 +- .../examples/get_comment_response.yaml | 5 +- .../examples/get_reporters_response.yaml | 17 +- .../examples/get_status_response.yaml | 7 - .../set_case_configuration_request.yaml | 7 +- .../set_case_configuration_response.yaml | 9 +- .../update_case_configuration_request.yaml | 18 + .../update_case_configuration_response.yaml | 43 + .../examples/update_case_request.yaml | 16 +- .../examples/update_case_response.yaml | 25 +- .../examples/update_comment_response.yaml | 21 +- .../schemas/case_response_properties.yaml | 6 + .../schemas/create_case_request.yaml | 4 +- .../schemas/custom_fields_property.yaml | 34 - .../components/schemas/customfields.yaml | 27 + .../schemas/update_case_request.yaml | 10 +- ...api@cases@configure@{configurationid}.yaml | 14 +- .../docs/openapi/paths/api@cases@status.yaml | 3 - .../api@cases@{caseid}@user_actions.yaml | 3 - ...api@cases@configure@{configurationid}.yaml | 14 +- .../paths/s@{spaceid}@api@cases@status.yaml | 3 - ...ceid}@api@cases@{caseid}@user_actions.yaml | 3 - 31 files changed, 1438 insertions(+), 1140 deletions(-) delete mode 100644 x-pack/plugins/cases/docs/openapi/components/examples/get_case_activity_response.yaml delete mode 100644 x-pack/plugins/cases/docs/openapi/components/examples/get_status_response.yaml create mode 100644 x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_request.yaml create mode 100644 x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_response.yaml delete mode 100644 x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml create mode 100644 x-pack/plugins/cases/docs/openapi/components/schemas/customfields.yaml diff --git a/x-pack/plugins/cases/docs/openapi/bundled.json b/x-pack/plugins/cases/docs/openapi/bundled.json index 498e225a9f5245..0d6f95da0fc2cf 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.json +++ b/x-pack/plugins/cases/docs/openapi/bundled.json @@ -785,6 +785,11 @@ "application/json": { "schema": { "$ref": "#/components/schemas/update_case_configuration_request" + }, + "examples": { + "updateCaseConfigurationRequest": { + "$ref": "#/components/examples/update_case_configuration_request" + } } } } @@ -795,164 +800,166 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "closure_type": { - "$ref": "#/components/schemas/closure_types" - }, - "customFields": { - "type": "array", - "x-technical-preview": true, - "description": "Custom fields configuration details.", - "items": { - "type": "object", - "properties": { - "key": { - "description": "The key identifying the custom field.", - "type": "string" - }, - "label": { - "description": "The custom field label.", - "type": "string" - }, - "required": { - "description": "Indicates whether the field is required.", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } - }, - "connector": { + "type": "object", + "properties": { + "closure_type": { + "$ref": "#/components/schemas/closure_types" + }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom fields configuration details.", + "items": { "type": "object", "properties": { - "fields": { - "description": "The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`.", - "nullable": true, - "type": "object" + "key": { + "description": "The key identifying the custom field.", + "type": "string" }, - "id": { - "description": "The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API.", - "type": "string", - "example": "none" + "label": { + "description": "The custom field label.", + "type": "string" }, - "name": { - "description": "The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API.", - "type": "string", - "example": "none" + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" }, "type": { - "$ref": "#/components/schemas/connector_types" - } - } - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-06-01T17:07:17.767Z" - }, - "created_by": { - "type": "object", - "properties": { - "email": { - "type": "string", - "example": null, - "nullable": true - }, - "full_name": { - "type": "string", - "example": null, - "nullable": true - }, - "username": { - "type": "string", - "example": "elastic", - "nullable": true - }, - "profile_uid": { + "description": "The type of the custom field.", "type": "string", - "example": "u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0" + "enum": [ + "text", + "toggle" + ] } } - }, - "error": { - "type": "string", - "nullable": true, - "example": null - }, - "id": { - "type": "string", - "example": "4a97a440-e1cd-11ec-be9b-9b1838238ee6" - }, - "mappings": { - "type": "array", - "items": { - "type": "object", - "properties": { - "action_type": { - "type": "string", - "example": "overwrite" - }, - "source": { - "type": "string", - "example": "title" - }, - "target": { - "type": "string", - "example": "summary" - } - } + } + }, + "connector": { + "type": "object", + "properties": { + "fields": { + "description": "The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`.", + "nullable": true, + "type": "object" + }, + "id": { + "description": "The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API.", + "type": "string", + "example": "none" + }, + "name": { + "description": "The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API.", + "type": "string", + "example": "none" + }, + "type": { + "$ref": "#/components/schemas/connector_types" } - }, - "owner": { - "$ref": "#/components/schemas/owners" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "nullable": true, - "example": "2022-06-01T19:58:48.169Z" - }, - "updated_by": { + } + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-06-01T17:07:17.767Z" + }, + "created_by": { + "type": "object", + "properties": { + "email": { + "type": "string", + "example": null, + "nullable": true + }, + "full_name": { + "type": "string", + "example": null, + "nullable": true + }, + "username": { + "type": "string", + "example": "elastic", + "nullable": true + }, + "profile_uid": { + "type": "string", + "example": "u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0" + } + } + }, + "error": { + "type": "string", + "nullable": true, + "example": null + }, + "id": { + "type": "string", + "example": "4a97a440-e1cd-11ec-be9b-9b1838238ee6" + }, + "mappings": { + "type": "array", + "items": { "type": "object", "properties": { - "email": { - "type": "string", - "example": null, - "nullable": true - }, - "full_name": { + "action_type": { "type": "string", - "example": null, - "nullable": true + "example": "overwrite" }, - "username": { + "source": { "type": "string", - "example": "elastic", - "nullable": true + "example": "title" }, - "profile_uid": { + "target": { "type": "string", - "example": "u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0" + "example": "summary" } + } + } + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "nullable": true, + "example": "2022-06-01T19:58:48.169Z" + }, + "updated_by": { + "type": "object", + "properties": { + "email": { + "type": "string", + "example": null, + "nullable": true }, - "nullable": true + "full_name": { + "type": "string", + "example": null, + "nullable": true + }, + "username": { + "type": "string", + "example": "elastic", + "nullable": true + }, + "profile_uid": { + "type": "string", + "example": "u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0" + } }, - "version": { - "type": "string", - "example": "WzIwNzMsMV0=" - } + "nullable": true + }, + "version": { + "type": "string", + "example": "WzIwNzMsMV0=" } } + }, + "examples": { + "updateCaseConfigurationResponse": { + "$ref": "#/components/examples/update_case_configuration_response" + } } } } @@ -1069,11 +1076,6 @@ "type": "integer" } } - }, - "examples": { - "getStatusResponse": { - "$ref": "#/components/examples/get_status_response" - } } } } @@ -1581,11 +1583,6 @@ "items": { "$ref": "#/components/schemas/user_actions_response_properties" } - }, - "examples": { - "getCaseActivityResponse": { - "$ref": "#/components/examples/get_case_activity_response" - } } } } @@ -2284,11 +2281,224 @@ } } } - }, - "post": { - "summary": "Sets external connection details, such as the closure type and default connector for cases.", - "operationId": "setCaseConfiguration", - "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details.\n", + }, + "post": { + "summary": "Sets external connection details, such as the closure type and default connector for cases.", + "operationId": "setCaseConfiguration", + "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details.\n", + "tags": [ + "cases" + ], + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "$ref": "#/components/parameters/space_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/set_case_configuration_request" + }, + "examples": { + "setCaseConfigRequest": { + "$ref": "#/components/examples/set_case_configuration_request" + } + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "closure_type": { + "$ref": "#/components/schemas/closure_types" + }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "key": { + "description": "The key identifying the custom field.", + "type": "string" + }, + "label": { + "description": "The custom field label.", + "type": "string" + }, + "required": { + "description": "Indicates whether the field is required.", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, + "connector": { + "type": "object", + "properties": { + "fields": { + "description": "The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`.", + "nullable": true, + "type": "object" + }, + "id": { + "description": "The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API.", + "type": "string", + "example": "none" + }, + "name": { + "description": "The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API.", + "type": "string", + "example": "none" + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + } + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-06-01T17:07:17.767Z" + }, + "created_by": { + "type": "object", + "properties": { + "email": { + "type": "string", + "example": null, + "nullable": true + }, + "full_name": { + "type": "string", + "example": null, + "nullable": true + }, + "username": { + "type": "string", + "example": "elastic", + "nullable": true + }, + "profile_uid": { + "type": "string", + "example": "u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0" + } + } + }, + "error": { + "type": "string", + "nullable": true, + "example": null + }, + "id": { + "type": "string", + "example": "4a97a440-e1cd-11ec-be9b-9b1838238ee6" + }, + "mappings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "action_type": { + "type": "string", + "example": "overwrite" + }, + "source": { + "type": "string", + "example": "title" + }, + "target": { + "type": "string", + "example": "summary" + } + } + } + }, + "owner": { + "$ref": "#/components/schemas/owners" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "nullable": true, + "example": "2022-06-01T19:58:48.169Z" + }, + "updated_by": { + "type": "object", + "properties": { + "email": { + "type": "string", + "example": null, + "nullable": true + }, + "full_name": { + "type": "string", + "example": null, + "nullable": true + }, + "username": { + "type": "string", + "example": "elastic", + "nullable": true + }, + "profile_uid": { + "type": "string", + "example": "u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0" + } + }, + "nullable": true + }, + "version": { + "type": "string", + "example": "WzIwNzMsMV0=" + } + } + }, + "examples": { + "setCaseConfigResponse": { + "$ref": "#/components/examples/set_case_configuration_response" + } + } + } + } + }, + "401": { + "description": "Authorization information is missing or invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4xx_response" + } + } + } + } + } + } + }, + "/s/{spaceId}/api/cases/configure/{configurationId}": { + "patch": { + "summary": "Updates external connection details, such as the closure type and default connector for cases.", + "operationId": "updateCaseConfiguration", + "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API.\n", "tags": [ "cases" ], @@ -2296,6 +2506,9 @@ { "$ref": "#/components/parameters/kbn_xsrf" }, + { + "$ref": "#/components/parameters/configuration_id" + }, { "$ref": "#/components/parameters/space_id" } @@ -2304,11 +2517,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/set_case_configuration_request" + "$ref": "#/components/schemas/update_case_configuration_request" }, "examples": { - "setCaseConfigRequest": { - "$ref": "#/components/examples/set_case_configuration_request" + "updateCaseConfigurationRequest": { + "$ref": "#/components/examples/update_case_configuration_request" } } } @@ -2477,217 +2690,8 @@ } }, "examples": { - "setCaseConfigResponse": { - "$ref": "#/components/examples/set_case_configuration_response" - } - } - } - } - }, - "401": { - "description": "Authorization information is missing or invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4xx_response" - } - } - } - } - } - } - }, - "/s/{spaceId}/api/cases/configure/{configurationId}": { - "patch": { - "summary": "Updates external connection details, such as the closure type and default connector for cases.", - "operationId": "updateCaseConfiguration", - "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API.\n", - "tags": [ - "cases" - ], - "parameters": [ - { - "$ref": "#/components/parameters/kbn_xsrf" - }, - { - "$ref": "#/components/parameters/configuration_id" - }, - { - "$ref": "#/components/parameters/space_id" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/update_case_configuration_request" - } - } - } - }, - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "closure_type": { - "$ref": "#/components/schemas/closure_types" - }, - "customFields": { - "type": "array", - "x-technical-preview": true, - "description": "Custom fields configuration details.", - "items": { - "type": "object", - "properties": { - "key": { - "description": "The key identifying the custom field.", - "type": "string" - }, - "label": { - "description": "The custom field label.", - "type": "string" - }, - "required": { - "description": "Indicates whether the field is required.", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } - }, - "connector": { - "type": "object", - "properties": { - "fields": { - "description": "The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`.", - "nullable": true, - "type": "object" - }, - "id": { - "description": "The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API.", - "type": "string", - "example": "none" - }, - "name": { - "description": "The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API.", - "type": "string", - "example": "none" - }, - "type": { - "$ref": "#/components/schemas/connector_types" - } - } - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-06-01T17:07:17.767Z" - }, - "created_by": { - "type": "object", - "properties": { - "email": { - "type": "string", - "example": null, - "nullable": true - }, - "full_name": { - "type": "string", - "example": null, - "nullable": true - }, - "username": { - "type": "string", - "example": "elastic", - "nullable": true - }, - "profile_uid": { - "type": "string", - "example": "u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0" - } - } - }, - "error": { - "type": "string", - "nullable": true, - "example": null - }, - "id": { - "type": "string", - "example": "4a97a440-e1cd-11ec-be9b-9b1838238ee6" - }, - "mappings": { - "type": "array", - "items": { - "type": "object", - "properties": { - "action_type": { - "type": "string", - "example": "overwrite" - }, - "source": { - "type": "string", - "example": "title" - }, - "target": { - "type": "string", - "example": "summary" - } - } - } - }, - "owner": { - "$ref": "#/components/schemas/owners" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "nullable": true, - "example": "2022-06-01T19:58:48.169Z" - }, - "updated_by": { - "type": "object", - "properties": { - "email": { - "type": "string", - "example": null, - "nullable": true - }, - "full_name": { - "type": "string", - "example": null, - "nullable": true - }, - "username": { - "type": "string", - "example": "elastic", - "nullable": true - }, - "profile_uid": { - "type": "string", - "example": "u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0" - } - }, - "nullable": true - }, - "version": { - "type": "string", - "example": "WzIwNzMsMV0=" - } - } + "updateCaseConfigurationResponse": { + "$ref": "#/components/examples/update_case_configuration_response" } } } @@ -2890,11 +2894,6 @@ "type": "integer" } } - }, - "examples": { - "getStatusResponse": { - "$ref": "#/components/examples/get_status_response" - } } } } @@ -3483,11 +3482,6 @@ "items": { "$ref": "#/components/schemas/user_actions_response_properties" } - }, - "examples": { - "getCaseActivityResponse": { - "$ref": "#/components/examples/get_case_activity_response" - } } } } @@ -4373,51 +4367,41 @@ ], "default": "low" }, - "custom_fields_property": { + "customfields": { "type": "array", - "description": "Values for custom fields of a case.", + "description": "Custom field values for a case.", "x-technical-preview": true, - "minItems": 0, - "maxItems": 5, "items": { "type": "object", "required": [ "key", "type", - "field" + "value" ], "properties": { "key": { - "description": "The key identifying the custom field.", + "description": "The unique identifier for the custom field.", "type": "string" }, "type": { - "description": "The type of the custom field. It should match the key and how the custom field was configured.\n", - "type": "string" - }, - "field": { - "description": "An object containing the value of the field.", - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "description": "The value of the field.", - "nullable": true, - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "boolean" - } - ] - } + "description": "The custom field type.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + }, + "value": { + "description": "The custom field value.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean", + "nullable": true } - } + ] } } } @@ -4487,7 +4471,7 @@ } }, "category": { - "description": "Category for the case. It could be a word or a phrase to categorize the case.", + "description": "A word or phrase that categorizes the case.", "type": "string", "maxLength": 50 }, @@ -4497,7 +4481,7 @@ "maxLength": 160 }, "customFields": { - "$ref": "#/components/schemas/custom_fields_property" + "$ref": "#/components/schemas/customfields" } } }, @@ -4909,6 +4893,11 @@ "assignees": { "$ref": "#/components/schemas/assignees" }, + "category": { + "type": "string", + "description": "The case category.", + "nullable": true + }, "closed_at": { "type": "string", "format": "date-time", @@ -4973,6 +4962,9 @@ "created_by": { "$ref": "#/components/schemas/case_response_created_by_properties" }, + "customFields": { + "$ref": "#/components/schemas/customfields" + }, "description": { "type": "string", "example": "A case description." @@ -5077,6 +5069,11 @@ "assignees": { "$ref": "#/components/schemas/assignees" }, + "category": { + "description": "A word or phrase that categorizes the case.", + "type": "string", + "maxLength": 50 + }, "connector": { "oneOf": [ { @@ -5103,7 +5100,7 @@ ] }, "customFields": { - "$ref": "#/components/schemas/custom_fields_property" + "$ref": "#/components/schemas/customfields" }, "description": { "description": "An updated description for the case.", @@ -5132,11 +5129,6 @@ "maxLength": 256 } }, - "category": { - "description": "Category for the case. It could be a word or a phrase to categorize the case.", - "type": "string", - "maxLength": 50 - }, "title": { "description": "A title for the case.", "type": "string", @@ -6253,7 +6245,14 @@ "settings": { "syncAlerts": true }, - "owner": "cases" + "owner": "cases", + "customFields": [ + { + "type": "text", + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "value": "My field value" + } + ] } }, "create_case_response": { @@ -6263,7 +6262,7 @@ "totalAlerts": 0, "id": "66b9aa00-94fa-11ea-9f74-e7e108796192", "version": "WzUzMiwxXQ==", - "totalComment": 1, + "totalComment": 0, "title": "Case title 1", "tags": [ "tag 1" @@ -6271,18 +6270,31 @@ "assignees": [], "description": "A case description.", "settings": { - "syncAlerts": false + "syncAlerts": true }, "owner": "cases", + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "My field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": null + } + ], "duration": null, "severity": "low", "closed_at": null, "closed_by": null, - "created_at": "2022-03-24T00:37:03.906Z", + "created_at": "2022-10-13T15:33:50.604Z", "created_by": { "username": "elastic", "full_name": null, - "email": null + "email": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "status": "open", "updated_at": null, @@ -6323,7 +6335,19 @@ ], "settings": { "syncAlerts": true - } + }, + "customFields": [ + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": false + }, + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "My new field value" + } + ] } ] } @@ -6350,20 +6374,35 @@ "severity": "low", "closed_at": null, "closed_by": null, - "created_at": "2022-05-13T09:16:17.416Z", + "created_at": "2023-10-13T09:16:17.416Z", "created_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "status": "open", - "updated_at": "2022-05-13T09:48:33.043Z", + "updated_at": "2023-10-13T09:48:33.043Z", "updated_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "assignees": [], + "category": null, + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "My new field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": false + } + ], "connector": { "id": "131d4448-abe0-4789-939d-8ef60680b498", "name": "My connector", @@ -6382,7 +6421,7 @@ "username": "elastic" }, "external_url": "https://hms.atlassian.net/browse/IS-4", - "pushed_at": "2022-05-13T09:20:40.672Z", + "pushed_at": "2023-10-13T09:20:40.672Z", "connector_id": "05da469f-1fde-4058-99a3-91e4807e2de8", "external_id": "10003", "connector_name": "Jira" @@ -6412,24 +6451,39 @@ "syncAlerts": true }, "owner": "cases", + "customFields": [ + { + "type": "text", + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "value": "My field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": null + } + ], "duration": null, "severity": "low", "closed_at": null, "closed_by": null, - "created_at": "2022-05-12T00:16:36.371Z", + "created_at": "2023-10-12T00:16:36.371Z", "created_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "status": "open", - "updated_at": "2022-05-12T00:27:58.162Z", + "updated_at": "2023-10-12T00:27:58.162Z", "updated_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "assignees": [], + "category": null, "connector": { "id": "none", "name": "none", @@ -6453,7 +6507,7 @@ "customFields": [ { "key": "d312efda-ec2b-42ec-9e2c-84981795c581", - "label": "my-field", + "label": "my-text-field", "required": false, "type": "text" } @@ -6489,20 +6543,36 @@ "type": ".jira", "fields": null }, - "closure_type": "close-by-user" + "closure_type": "close-by-user", + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "label": "my-text-field", + "required": false, + "type": "text" + } + ] } }, "set_case_configuration_response": { - "summary": "This is an example response when the case configuration was updated.", + "summary": "This is an example response for case settings.", "value": { "closure_type": "close-by-user", - "customFields": [], + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "label": "my-text-field", + "required": false, + "type": "text" + } + ], "owner": "cases", "created_at": "2023-10-01T17:07:17.767Z", "created_by": { "username": "elastic", "email": "null,", - "full_name": null + "full_name": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "updated_at": null, "updated_by": null, @@ -6534,34 +6604,111 @@ "id": "4a97a440-e1cd-11ec-be9b-9b1838238ee6" } }, + "update_case_configuration_request": { + "summary": "Update the case settings.", + "value": { + "version": "WzExOSw0XQ==", + "connector": { + "id": "5e656730-e1ca-11ec-be9b-9b1838238ee6", + "name": "my-jira-connector", + "type": ".jira", + "fields": null + }, + "closure_type": "close-by-user", + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "label": "my-text-field", + "required": true, + "type": "text" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "label": "my-toggle", + "required": false, + "type": "toggle" + } + ] + } + }, + "update_case_configuration_response": { + "summary": "This is an example response when the case configuration was updated.", + "value": { + "closure_type": "close-by-user", + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "label": "my-text-field", + "required": true, + "type": "text" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "label": "my-toggle", + "required": false, + "type": "toggle" + } + ], + "owner": "cases", + "created_at": "2023-10-01T17:07:17.767Z", + "created_by": { + "username": "elastic", + "email": "null,", + "full_name": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" + }, + "updated_at": "2023-10-19T00:52:42.401Z", + "updated_by": { + "username": "elastic", + "full_name": null, + "email": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" + }, + "connector": { + "id": "5e656730-e1ca-11ec-be9b-9b1838238ee6", + "name": "my-jira-connector", + "type": ".jira", + "fields": null + }, + "mappings": [ + { + "source": "title", + "target": "summary", + "action_type": "overwrite" + }, + { + "source": "description", + "target": "description", + "action_type": "overwrite" + }, + { + "source": "comments", + "target": "comments", + "action_type": "append" + } + ], + "version": "zEzNSw1XQ==", + "error": null, + "id": "4a97a440-e1cd-11ec-be9b-9b1838238ee6" + } + }, "get_reporters_response": { - "summary": "A list of three users that opened cases", + "summary": "A list of two users that opened cases", "value": [ { "username": "elastic", "full_name": null, - "email": null - }, - { - "username": "user1", - "full_name": "User 1", - "email": "user1@elastic.co" + "email": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, { - "username": "user2", - "full_name": "User 2", - "email": "user2@elastic.co" + "username": "jdoe", + "full_name": "Jane Doe", + "email": "jdoe@example.com", + "profile_uid": "u_0wpfV1MqYDaXzLtRVY-gLMrddKDEmfz51Fszhj7hWC8_0" } ] }, - "get_status_response": { - "summary": "Get the number of cases in each state.", - "value": { - "count_open_cases": 27, - "count_in_progress_cases": 50, - "count_closed_cases": 198 - } - }, "get_tags_response": { "summary": "A list of tags that are used in cases", "value": [ @@ -6583,11 +6730,12 @@ "type": "user", "owner": "cases", "comment": "A new comment", - "created_at": "2022-07-13T15:40:32.335Z", + "created_at": "2023-10-13T15:40:32.335Z", "created_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "pushed_at": null, "pushed_by": null, @@ -6605,23 +6753,37 @@ "syncAlerts": true }, "owner": "cases", + "customFields": [ + { + "type": "text", + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "value": "My field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": null + } + ], "description": "A case description", "duration": null, "severity": "low", "closed_at": null, "closed_by": null, - "created_at": "2022-07-13T15:33:50.604Z", + "created_at": "2023-10-13T15:33:50.604Z", "created_by": { "username": "elastic", "email": null, - "full_name": null + "full_name": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "status": "open", - "updated_at": "2022-07-13T15:40:32.335Z", + "updated_at": "2023-10-13T15:40:32.335Z", "updated_by": { "full_name": null, "email": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "assignees": [ { @@ -6665,7 +6827,7 @@ "type": "user", "owner": "cases", "comment": "A new comment.", - "created_at": "2022-06-02T00:49:47.716Z", + "created_at": "2022-10-02T00:49:47.716Z", "created_by": { "username": "elastic", "email": null, @@ -6682,6 +6844,20 @@ "tag 1" ], "description": "A case description.", + "category": null, + "assignees": [], + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "Field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": true + } + ], "settings": { "syncAlerts": false }, @@ -6694,14 +6870,16 @@ "created_by": { "username": "elastic", "full_name": null, - "email": null + "email": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "status": "open", "updated_at": "2022-06-03T00:49:47.716Z", "updated_by": { "username": "elastic", "email": null, - "full_name": null + "full_name": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "connector": { "id": "none", @@ -6732,19 +6910,21 @@ "comment": "An updated comment.", "type": "user", "owner": "cases", - "created_at": "2022-03-24T00:37:10.832Z", + "created_at": "2023-10-24T00:37:10.832Z", "created_by": { "username": "elastic", "full_name": null, - "email": null + "email": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "pushed_at": null, "pushed_by": null, - "updated_at": "2022-03-24T01:27:06.210Z", + "updated_at": "2023-10-24T01:27:06.210Z", "updated_by": { "username": "elastic", "full_name": null, - "email": null + "email": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } } ], @@ -6761,22 +6941,38 @@ "syncAlerts": false }, "owner": "cases", + "category": null, + "assignees": [], + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "My new field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": false + } + ], "duration": null, "severity": "low", "closed_at": null, "closed_by": null, - "created_at": "2022-03-24T00:37:03.906Z", + "created_at": "2023-10-24T00:37:03.906Z", "created_by": { "username": "elastic", "full_name": null, - "email": null + "email": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "status": "open", - "updated_at": "2022-03-24T01:27:06.210Z", + "updated_at": "2023-10-24T01:27:06.210Z", "updated_by": { "username": "elastic", "full_name": null, - "email": null + "email": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "connector": { "id": "none", @@ -6795,11 +6991,12 @@ "type": "user", "owner": "cases", "comment": "A new comment", - "created_at": "2022-07-07T19:32:13.104Z", + "created_at": "2023-10-07T19:32:13.104Z", "created_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "pushed_at": null, "pushed_by": null, @@ -6866,151 +7063,71 @@ } } }, - "get_case_activity_response": { - "summary": "Retrieves all activity for a case", - "value": [ - { - "action_id": "b4cd0770-07c9-11ed-a5fd-47154cb8767e", - "action": "create", - "case_id": "22df07d0-03b1-11ed-920c-974bfa104448", - "comment_id": "578608d0-03b1-11ed-920c-974bfa104448", - "created_at": "2022-07-20T01:17:22.150Z", - "created_by": { - "username": "elastic", - "email": null, - "full_name": null - }, - "owner": "cases", - "payload": { - "assignees": null, - "connector": { - "name": "none", - "type": ".none", - "fields": null, - "id": "none" - }, - "description": "test", - "tags": [ - "mine" - ], - "title": "test-case", - "owner": "cases", - "settings": { - "syncAlerts": false - }, - "severity": "low", - "status": "open", - "type": "create_case" - }, - "type": "comment" - }, - { - "action_id": "57af14a0-03b1-11ed-920c-974bfa104448", - "action": "create", - "case_id": "22df07d0-03b1-11ed-920c-974bfa104448", - "comment_id": "578608d0-03b1-11ed-920c-974bfa104448", - "created_at": "2022-07-14T20:12:53.354Z", - "created_by": { - "username": "elastic", - "email": null, - "full_name": null - }, - "owner": "cases", - "payload": { - "comment": "A new comment", - "owner": "cases", - "type": "user" - }, - "type": "comment" - }, - { - "action_id": "573c6980-6123-11ed-aa41-81a0a61fe447", - "action": "add", - "case_id": "22df07d0-03b1-11ed-920c-974bfa104448", - "comment_id": null, - "created_at": "2022-07-20T01:10:28.238Z", - "created_by": { - "username": "elastic", - "email": null, - "full_name": null, - "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" - }, - "owner": "cases", - "payload": { - "assignees": { - "uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" - } - }, - "type": "assignees" - }, - { - "action_id": "fff460e0-07c9-11ed-a5fd-47154cb8767e", - "action": "delete", - "case_id": "22df07d0-03b1-11ed-920c-974bfa104448", - "comment_id": null, - "created_at": "2022-07-20T01:19:28.238Z", - "created_by": { - "username": "elastic", - "email": null, - "full_name": null - }, - "owner": "cases", - "payload": null, - "type": "delete_case" - } - ] - }, "find_case_activity_response": { "summary": "Retrieves all activity for a case", "value": { "page": 1, "perPage": 20, - "total": 4, + "total": 3, "userActions": [ { "id": "b4cd0770-07c9-11ed-a5fd-47154cb8767e", "action": "create", - "comment_id": "578608d0-03b1-11ed-920c-974bfa104448", - "created_at": "2022-07-20T01:17:22.150Z", + "comment_id": null, + "created_at": "2023-10-20T01:17:22.150Z", "created_by": { "username": "elastic", "email": null, - "full_name": null + "full_name": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "owner": "cases", "payload": { - "assignees": null, + "assignees": [], "connector": { "name": "none", "type": ".none", "fields": null, "id": "none" }, - "description": "test", + "description": "A case description.", "tags": [ - "mine" + "tag 1" ], - "title": "test-case", + "title": "Case title 1", "owner": "cases", "settings": { "syncAlerts": false }, "severity": "low", "status": "open", - "type": "create_case" + "category": null, + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "My field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": null + } + ] }, "version": "WzM1ODg4LDFd", - "type": "comment" + "type": "create_case" }, { "id": "57af14a0-03b1-11ed-920c-974bfa104448", "action": "create", "comment_id": "578608d0-03b1-11ed-920c-974bfa104448", - "created_at": "2022-07-14T20:12:53.354Z", + "created_at": "2023-10-14T20:12:53.354Z", "created_by": { "username": "elastic", "email": null, - "full_name": null + "full_name": null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "owner": "cases", "payload": { @@ -7025,7 +7142,7 @@ "id": "573c6980-6123-11ed-aa41-81a0a61fe447", "action": "add", "comment_id": null, - "created_at": "2022-07-20T01:10:28.238Z", + "created_at": "2023-10-20T01:10:28.238Z", "created_by": { "username": "elastic", "email": null, diff --git a/x-pack/plugins/cases/docs/openapi/bundled.yaml b/x-pack/plugins/cases/docs/openapi/bundled.yaml index 20aa0bf4a98d27..cc7f78df14b233 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.yaml +++ b/x-pack/plugins/cases/docs/openapi/bundled.yaml @@ -511,129 +511,133 @@ paths: application/json: schema: $ref: '#/components/schemas/update_case_configuration_request' + examples: + updateCaseConfigurationRequest: + $ref: '#/components/examples/update_case_configuration_request' responses: '200': description: Indicates a successful call. content: application/json: schema: - type: array - items: - type: object - properties: - closure_type: - $ref: '#/components/schemas/closure_types' - customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - key: - description: The key identifying the custom field. - type: string - label: - description: The custom field label. - type: string - required: - description: Indicates whether the field is required. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle - connector: + type: object + properties: + closure_type: + $ref: '#/components/schemas/closure_types' + customFields: + type: array + x-technical-preview: true + description: Custom fields configuration details. + items: type: object properties: - fields: - description: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`. - nullable: true - type: object - id: - description: The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API. + key: + description: The key identifying the custom field. type: string - example: none - name: - description: The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API. + label: + description: The custom field label. type: string - example: none + required: + description: Indicates whether the field is required. + type: boolean type: - $ref: '#/components/schemas/connector_types' - created_at: - type: string - format: date-time - example: '2022-06-01T17:07:17.767Z' - created_by: - type: object - properties: - email: - type: string - example: null - nullable: true - full_name: - type: string - example: null - nullable: true - username: - type: string - example: elastic - nullable: true - profile_uid: + description: The type of the custom field. type: string - example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 - error: - type: string - nullable: true - example: null - id: - type: string - example: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 - mappings: - type: array - items: + enum: + - text + - toggle + connector: + type: object + properties: + fields: + description: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`. + nullable: true type: object - properties: - action_type: - type: string - example: overwrite - source: - type: string - example: title - target: - type: string - example: summary - owner: - $ref: '#/components/schemas/owners' - updated_at: - type: string - format: date-time - nullable: true - example: '2022-06-01T19:58:48.169Z' - updated_by: + id: + description: The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API. + type: string + example: none + name: + description: The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API. + type: string + example: none + type: + $ref: '#/components/schemas/connector_types' + created_at: + type: string + format: date-time + example: '2022-06-01T17:07:17.767Z' + created_by: + type: object + properties: + email: + type: string + example: null + nullable: true + full_name: + type: string + example: null + nullable: true + username: + type: string + example: elastic + nullable: true + profile_uid: + type: string + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + error: + type: string + nullable: true + example: null + id: + type: string + example: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + mappings: + type: array + items: type: object properties: - email: - type: string - example: null - nullable: true - full_name: + action_type: type: string - example: null - nullable: true - username: + example: overwrite + source: type: string - example: elastic - nullable: true - profile_uid: + example: title + target: type: string - example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 - nullable: true - version: - type: string - example: WzIwNzMsMV0= + example: summary + owner: + $ref: '#/components/schemas/owners' + updated_at: + type: string + format: date-time + nullable: true + example: '2022-06-01T19:58:48.169Z' + updated_by: + type: object + properties: + email: + type: string + example: null + nullable: true + full_name: + type: string + example: null + nullable: true + username: + type: string + example: elastic + nullable: true + profile_uid: + type: string + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + nullable: true + version: + type: string + example: WzIwNzMsMV0= + examples: + updateCaseConfigurationResponse: + $ref: '#/components/examples/update_case_configuration_response' '401': description: Authorization information is missing or invalid. content: @@ -710,9 +714,6 @@ paths: type: integer count_open_cases: type: integer - examples: - getStatusResponse: - $ref: '#/components/examples/get_status_response' '401': description: Authorization information is missing or invalid. content: @@ -1020,9 +1021,6 @@ paths: type: array items: $ref: '#/components/schemas/user_actions_response_properties' - examples: - getCaseActivityResponse: - $ref: '#/components/examples/get_case_activity_response' '401': description: Authorization information is missing or invalid. content: @@ -1618,129 +1616,133 @@ paths: application/json: schema: $ref: '#/components/schemas/update_case_configuration_request' + examples: + updateCaseConfigurationRequest: + $ref: '#/components/examples/update_case_configuration_request' responses: '200': description: Indicates a successful call. content: application/json: schema: - type: array - items: - type: object - properties: - closure_type: - $ref: '#/components/schemas/closure_types' - customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - key: - description: The key identifying the custom field. - type: string - label: - description: The custom field label. - type: string - required: - description: Indicates whether the field is required. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle - connector: - type: object - properties: - fields: - description: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`. - nullable: true - type: object - id: - description: The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API. - type: string - example: none - name: - description: The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API. - type: string - example: none - type: - $ref: '#/components/schemas/connector_types' - created_at: - type: string - format: date-time - example: '2022-06-01T17:07:17.767Z' - created_by: - type: object - properties: - email: - type: string - example: null - nullable: true - full_name: - type: string - example: null - nullable: true - username: - type: string - example: elastic - nullable: true - profile_uid: - type: string - example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 - error: - type: string - nullable: true - example: null - id: - type: string - example: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 - mappings: - type: array - items: - type: object - properties: - action_type: - type: string - example: overwrite - source: - type: string - example: title - target: - type: string - example: summary - owner: - $ref: '#/components/schemas/owners' - updated_at: - type: string - format: date-time - nullable: true - example: '2022-06-01T19:58:48.169Z' - updated_by: + type: object + properties: + closure_type: + $ref: '#/components/schemas/closure_types' + customFields: + type: array + x-technical-preview: true + description: Custom fields configuration details. + items: type: object properties: - email: + key: + description: The key identifying the custom field. type: string - example: null - nullable: true - full_name: + label: + description: The custom field label. type: string - example: null - nullable: true - username: + required: + description: Indicates whether the field is required. + type: boolean + type: + description: The type of the custom field. type: string - example: elastic - nullable: true - profile_uid: + enum: + - text + - toggle + connector: + type: object + properties: + fields: + description: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`. + nullable: true + type: object + id: + description: The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API. + type: string + example: none + name: + description: The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API. + type: string + example: none + type: + $ref: '#/components/schemas/connector_types' + created_at: + type: string + format: date-time + example: '2022-06-01T17:07:17.767Z' + created_by: + type: object + properties: + email: + type: string + example: null + nullable: true + full_name: + type: string + example: null + nullable: true + username: + type: string + example: elastic + nullable: true + profile_uid: + type: string + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + error: + type: string + nullable: true + example: null + id: + type: string + example: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + mappings: + type: array + items: + type: object + properties: + action_type: type: string - example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 - nullable: true - version: - type: string - example: WzIwNzMsMV0= + example: overwrite + source: + type: string + example: title + target: + type: string + example: summary + owner: + $ref: '#/components/schemas/owners' + updated_at: + type: string + format: date-time + nullable: true + example: '2022-06-01T19:58:48.169Z' + updated_by: + type: object + properties: + email: + type: string + example: null + nullable: true + full_name: + type: string + example: null + nullable: true + username: + type: string + example: elastic + nullable: true + profile_uid: + type: string + example: u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0 + nullable: true + version: + type: string + example: WzIwNzMsMV0= + examples: + updateCaseConfigurationResponse: + $ref: '#/components/examples/update_case_configuration_response' '401': description: Authorization information is missing or invalid. content: @@ -1869,9 +1871,6 @@ paths: type: integer count_open_cases: type: integer - examples: - getStatusResponse: - $ref: '#/components/examples/get_status_response' '401': description: Authorization information is missing or invalid. content: @@ -2216,9 +2215,6 @@ paths: type: array items: $ref: '#/components/schemas/user_actions_response_properties' - examples: - getCaseActivityResponse: - $ref: '#/components/examples/get_case_activity_response' '401': description: Authorization information is missing or invalid. content: @@ -2870,40 +2866,32 @@ components: - low - medium default: low - custom_fields_property: + customfields: type: array - description: Values for custom fields of a case. + description: Custom field values for a case. x-technical-preview: true - minItems: 0 - maxItems: 5 items: type: object required: - key - type - - field + - value properties: key: - description: The key identifying the custom field. + description: The unique identifier for the custom field. type: string type: - description: | - The type of the custom field. It should match the key and how the custom field was configured. + description: The custom field type. type: string - field: - description: An object containing the value of the field. - type: object - required: - - value - properties: - value: - description: The value of the field. + enum: + - text + - toggle + value: + description: The custom field value. + oneOf: + - type: string + - type: boolean nullable: true - type: array - items: - anyOf: - - type: string - - type: boolean create_case_request: title: Create case request description: The create case API request body varies depending on the type of connector. @@ -2945,7 +2933,7 @@ components: type: string maxLength: 256 category: - description: Category for the case. It could be a word or a phrase to categorize the case. + description: A word or phrase that categorizes the case. type: string maxLength: 50 title: @@ -2953,7 +2941,7 @@ components: type: string maxLength: 160 customFields: - $ref: '#/components/schemas/custom_fields_property' + $ref: '#/components/schemas/customfields' case_response_closed_by_properties: title: Case response properties for closed_by type: object @@ -3266,6 +3254,10 @@ components: properties: assignees: $ref: '#/components/schemas/assignees' + category: + type: string + description: The case category. + nullable: true closed_at: type: string format: date-time @@ -3301,6 +3293,8 @@ components: example: '2022-05-13T09:16:17.416Z' created_by: $ref: '#/components/schemas/case_response_created_by_properties' + customFields: + $ref: '#/components/schemas/customfields' description: type: string example: A case description. @@ -3379,6 +3373,10 @@ components: properties: assignees: $ref: '#/components/schemas/assignees' + category: + description: A word or phrase that categorizes the case. + type: string + maxLength: 50 connector: oneOf: - $ref: '#/components/schemas/connector_properties_none' @@ -3389,7 +3387,7 @@ components: - $ref: '#/components/schemas/connector_properties_servicenow_sir' - $ref: '#/components/schemas/connector_properties_swimlane' customFields: - $ref: '#/components/schemas/custom_fields_property' + $ref: '#/components/schemas/customfields' description: description: An updated description for the case. type: string @@ -3410,10 +3408,6 @@ components: items: type: string maxLength: 256 - category: - description: Category for the case. It could be a word or a phrase to categorize the case. - type: string - maxLength: 50 title: description: A title for the case. type: string @@ -4198,6 +4192,10 @@ components: settings: syncAlerts: true owner: cases + customFields: + - type: text + key: d312efda-ec2b-42ec-9e2c-84981795c581 + value: My field value create_case_response: summary: The create case API returns a JSON object that contains details about the case. value: @@ -4205,24 +4203,32 @@ components: totalAlerts: 0 id: 66b9aa00-94fa-11ea-9f74-e7e108796192 version: WzUzMiwxXQ== - totalComment: 1 + totalComment: 0 title: Case title 1 tags: - tag 1 assignees: [] description: A case description. settings: - syncAlerts: false + syncAlerts: true owner: cases + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null duration: null severity: low closed_at: null closed_by: null - created_at: '2022-03-24T00:37:03.906Z' + created_at: '2022-10-13T15:33:50.604Z' created_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open updated_at: null updated_by: null @@ -4254,6 +4260,13 @@ components: - tag-1 settings: syncAlerts: true + customFields: + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: false + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My new field value update_case_response: summary: This is an example response when the case description, tags, and connector were updated. value: @@ -4273,18 +4286,28 @@ components: severity: low closed_at: null closed_by: null - created_at: '2022-05-13T09:16:17.416Z' + created_at: '2023-10-13T09:16:17.416Z' created_by: email: null full_name: null username: elastic + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open - updated_at: '2022-05-13T09:48:33.043Z' + updated_at: '2023-10-13T09:48:33.043Z' updated_by: email: null full_name: null username: elastic + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 assignees: [] + category: null + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My new field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: false connector: id: 131d4448-abe0-4789-939d-8ef60680b498 name: My connector @@ -4300,7 +4323,7 @@ components: email: null username: elastic external_url: https://hms.atlassian.net/browse/IS-4 - pushed_at: '2022-05-13T09:20:40.672Z' + pushed_at: '2023-10-13T09:20:40.672Z' connector_id: 05da469f-1fde-4058-99a3-91e4807e2de8 external_id: '10003' connector_name: Jira @@ -4323,22 +4346,32 @@ components: settings: syncAlerts: true owner: cases + customFields: + - type: text + key: d312efda-ec2b-42ec-9e2c-84981795c581 + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null duration: null severity: low closed_at: null closed_by: null - created_at: '2022-05-12T00:16:36.371Z' + created_at: '2023-10-12T00:16:36.371Z' created_by: email: null full_name: null username: elastic + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open - updated_at: '2022-05-12T00:27:58.162Z' + updated_at: '2023-10-12T00:27:58.162Z' updated_by: email: null full_name: null username: elastic + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 assignees: [] + category: null connector: id: none name: none @@ -4355,7 +4388,7 @@ components: closure_type: close-by-user customFields: - key: d312efda-ec2b-42ec-9e2c-84981795c581 - label: my-field + label: my-text-field required: false type: text owner: cases @@ -4384,17 +4417,27 @@ components: type: .jira fields: null closure_type: close-by-user + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + required: false + type: text set_case_configuration_response: - summary: This is an example response when the case configuration was updated. + summary: This is an example response for case settings. value: closure_type: close-by-user - customFields: [] + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + required: false + type: text owner: cases created_at: '2023-10-01T17:07:17.767Z' created_by: username: elastic email: null, full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 updated_at: null updated_by: null connector: @@ -4415,24 +4458,80 @@ components: version: WzIwNzMsMV0= error: null id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + update_case_configuration_request: + summary: Update the case settings. + value: + version: WzExOSw0XQ== + connector: + id: 5e656730-e1ca-11ec-be9b-9b1838238ee6 + name: my-jira-connector + type: .jira + fields: null + closure_type: close-by-user + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + required: true + type: text + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + label: my-toggle + required: false + type: toggle + update_case_configuration_response: + summary: This is an example response when the case configuration was updated. + value: + closure_type: close-by-user + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + required: true + type: text + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + label: my-toggle + required: false + type: toggle + owner: cases + created_at: '2023-10-01T17:07:17.767Z' + created_by: + username: elastic + email: null, + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + updated_at: '2023-10-19T00:52:42.401Z' + updated_by: + username: elastic + full_name: null + email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + connector: + id: 5e656730-e1ca-11ec-be9b-9b1838238ee6 + name: my-jira-connector + type: .jira + fields: null + mappings: + - source: title + target: summary + action_type: overwrite + - source: description + target: description + action_type: overwrite + - source: comments + target: comments + action_type: append + version: zEzNSw1XQ== + error: null + id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 get_reporters_response: - summary: A list of three users that opened cases + summary: A list of two users that opened cases value: - username: elastic full_name: null email: null - - username: user1 - full_name: User 1 - email: user1@elastic.co - - username: user2 - full_name: User 2 - email: user2@elastic.co - get_status_response: - summary: Get the number of cases in each state. - value: - count_open_cases: 27 - count_in_progress_cases: 50 - count_closed_cases: 198 + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + - username: jdoe + full_name: Jane Doe + email: jdoe@example.com + profile_uid: u_0wpfV1MqYDaXzLtRVY-gLMrddKDEmfz51Fszhj7hWC8_0 get_tags_response: summary: A list of tags that are used in cases value: @@ -4451,11 +4550,12 @@ components: type: user owner: cases comment: A new comment - created_at: '2022-07-13T15:40:32.335Z' + created_at: '2023-10-13T15:40:32.335Z' created_by: email: null full_name: null username: elastic + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 pushed_at: null pushed_by: null updated_at: null @@ -4468,22 +4568,31 @@ components: settings: syncAlerts: true owner: cases + customFields: + - type: text + key: d312efda-ec2b-42ec-9e2c-84981795c581 + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null description: A case description duration: null severity: low closed_at: null closed_by: null - created_at: '2022-07-13T15:33:50.604Z' + created_at: '2023-10-13T15:33:50.604Z' created_by: username: elastic email: null full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open - updated_at: '2022-07-13T15:40:32.335Z' + updated_at: '2023-10-13T15:40:32.335Z' updated_by: full_name: null email: null username: elastic + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 assignees: - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 connector: @@ -4513,7 +4622,7 @@ components: type: user owner: cases comment: A new comment. - created_at: '2022-06-02T00:49:47.716Z' + created_at: '2022-10-02T00:49:47.716Z' created_by: username: elastic email: null @@ -4526,6 +4635,15 @@ components: tags: - tag 1 description: A case description. + category: null + assignees: [] + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: Field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: true settings: syncAlerts: false owner: cases @@ -4538,12 +4656,14 @@ components: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open updated_at: '2022-06-03T00:49:47.716Z' updated_by: username: elastic email: null full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 connector: id: none name: none @@ -4567,18 +4687,20 @@ components: comment: An updated comment. type: user owner: cases - created_at: '2022-03-24T00:37:10.832Z' + created_at: '2023-10-24T00:37:10.832Z' created_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 pushed_at: null pushed_by: null - updated_at: '2022-03-24T01:27:06.210Z' + updated_at: '2023-10-24T01:27:06.210Z' updated_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 totalAlerts: 0 id: 293f1bc0-74f6-11ea-b83a-553aecdb28b6 version: WzIwNjM2LDFd @@ -4590,21 +4712,32 @@ components: settings: syncAlerts: false owner: cases + category: null + assignees: [] + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My new field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: false duration: null severity: low closed_at: null closed_by: null - created_at: '2022-03-24T00:37:03.906Z' + created_at: '2023-10-24T00:37:03.906Z' created_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open - updated_at: '2022-03-24T01:27:06.210Z' + updated_at: '2023-10-24T01:27:06.210Z' updated_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 connector: id: none name: none @@ -4619,11 +4752,12 @@ components: type: user owner: cases comment: A new comment - created_at: '2022-07-07T19:32:13.104Z' + created_at: '2023-10-07T19:32:13.104Z' created_by: email: null full_name: null username: elastic + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 pushed_at: null pushed_by: null updated_at: null @@ -4677,122 +4811,58 @@ components: external_title: ES-554 external_url: https://cases.jira.com connector_id: 09f8c0b0-0eda-11ed-bd18-65557fe66949 - get_case_activity_response: - summary: Retrieves all activity for a case - value: - - action_id: b4cd0770-07c9-11ed-a5fd-47154cb8767e - action: create - case_id: 22df07d0-03b1-11ed-920c-974bfa104448 - comment_id: 578608d0-03b1-11ed-920c-974bfa104448 - created_at: '2022-07-20T01:17:22.150Z' - created_by: - username: elastic - email: null - full_name: null - owner: cases - payload: - assignees: null - connector: - name: none - type: .none - fields: null - id: none - description: test - tags: - - mine - title: test-case - owner: cases - settings: - syncAlerts: false - severity: low - status: open - type: create_case - type: comment - - action_id: 57af14a0-03b1-11ed-920c-974bfa104448 - action: create - case_id: 22df07d0-03b1-11ed-920c-974bfa104448 - comment_id: 578608d0-03b1-11ed-920c-974bfa104448 - created_at: '2022-07-14T20:12:53.354Z' - created_by: - username: elastic - email: null - full_name: null - owner: cases - payload: - comment: A new comment - owner: cases - type: user - type: comment - - action_id: 573c6980-6123-11ed-aa41-81a0a61fe447 - action: add - case_id: 22df07d0-03b1-11ed-920c-974bfa104448 - comment_id: null - created_at: '2022-07-20T01:10:28.238Z' - created_by: - username: elastic - email: null - full_name: null - profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 - owner: cases - payload: - assignees: - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 - type: assignees - - action_id: fff460e0-07c9-11ed-a5fd-47154cb8767e - action: delete - case_id: 22df07d0-03b1-11ed-920c-974bfa104448 - comment_id: null - created_at: '2022-07-20T01:19:28.238Z' - created_by: - username: elastic - email: null - full_name: null - owner: cases - payload: null - type: delete_case find_case_activity_response: summary: Retrieves all activity for a case value: page: 1 perPage: 20 - total: 4 + total: 3 userActions: - id: b4cd0770-07c9-11ed-a5fd-47154cb8767e action: create - comment_id: 578608d0-03b1-11ed-920c-974bfa104448 - created_at: '2022-07-20T01:17:22.150Z' + comment_id: null + created_at: '2023-10-20T01:17:22.150Z' created_by: username: elastic email: null full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 owner: cases payload: - assignees: null + assignees: [] connector: name: none type: .none fields: null id: none - description: test + description: A case description. tags: - - mine - title: test-case + - tag 1 + title: Case title 1 owner: cases settings: syncAlerts: false severity: low status: open - type: create_case + category: null + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null version: WzM1ODg4LDFd - type: comment + type: create_case - id: 57af14a0-03b1-11ed-920c-974bfa104448 action: create comment_id: 578608d0-03b1-11ed-920c-974bfa104448 - created_at: '2022-07-14T20:12:53.354Z' + created_at: '2023-10-14T20:12:53.354Z' created_by: username: elastic email: null full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 owner: cases payload: comment: A new comment @@ -4803,7 +4873,7 @@ components: - id: 573c6980-6123-11ed-aa41-81a0a61fe447 action: add comment_id: null - created_at: '2022-07-20T01:10:28.238Z' + created_at: '2023-10-20T01:10:28.238Z' created_by: username: elastic email: null diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/add_comment_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/add_comment_response.yaml index 382629e4fab085..d47129cad1defb 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/add_comment_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/add_comment_response.yaml @@ -6,7 +6,7 @@ value: type: user owner: cases comment: A new comment. - created_at: '2022-06-02T00:49:47.716Z' + created_at: '2022-10-02T00:49:47.716Z' created_by: username: elastic email: null @@ -19,6 +19,15 @@ value: tags: - tag 1 description: A case description. + category: null + assignees: [] + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: Field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: true settings: syncAlerts: false owner: cases @@ -31,12 +40,14 @@ value: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open updated_at: '2022-06-03T00:49:47.716Z' updated_by: username: elastic email: null full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 connector: id: none name: none diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/create_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/create_case_request.yaml index 0e5b6c01aa3b69..7f726021ad550a 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/create_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/create_case_request.yaml @@ -17,5 +17,12 @@ value: "settings": { "syncAlerts": true }, - "owner": "cases" + "owner": "cases", + "customFields": [ + { + "type": "text", + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "value": "My field value" + } + ] } diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/create_case_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/create_case_response.yaml index 8cd80595abf30e..3fd4a41b87ae4a 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/create_case_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/create_case_response.yaml @@ -4,24 +4,32 @@ value: totalAlerts: 0 id: 66b9aa00-94fa-11ea-9f74-e7e108796192 version: WzUzMiwxXQ== - totalComment: 1 + totalComment: 0 title: Case title 1 tags: - tag 1 assignees: [] description: A case description. settings: - syncAlerts: false + syncAlerts: true owner: cases + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null duration: null severity: low closed_at: null closed_by: null - created_at: '2022-03-24T00:37:03.906Z' + created_at: '2022-10-13T15:33:50.604Z' created_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open updated_at: null updated_by: null diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/find_case_activity_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/find_case_activity_response.yaml index 49d5bd7684a740..cb5f9570845aa5 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/find_case_activity_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/find_case_activity_response.yaml @@ -2,44 +2,53 @@ summary: Retrieves all activity for a case value: page: 1 perPage: 20 - total: 4 + total: 3 userActions: - id: b4cd0770-07c9-11ed-a5fd-47154cb8767e action: create - comment_id: 578608d0-03b1-11ed-920c-974bfa104448 - created_at: 2022-07-20T01:17:22.150Z + comment_id: null + created_at: 2023-10-20T01:17:22.150Z created_by: username: elastic email: null full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 owner: cases payload: - assignees: + assignees: [] connector: name: none type: .none fields: null id: none - description: test + description: A case description. tags: - - mine - title: test-case + - tag 1 + title: Case title 1 owner: cases settings: syncAlerts: false severity: low status: open - type: create_case + category: null + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: null version: WzM1ODg4LDFd - type: comment + type: create_case - id: 57af14a0-03b1-11ed-920c-974bfa104448 action: create comment_id: 578608d0-03b1-11ed-920c-974bfa104448 - created_at: 2022-07-14T20:12:53.354Z + created_at: 2023-10-14T20:12:53.354Z created_by: username: elastic email: null full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 owner: cases payload: comment: A new comment @@ -50,7 +59,7 @@ value: - id: 573c6980-6123-11ed-aa41-81a0a61fe447 action: add comment_id: null - created_at: 2022-07-20T01:10:28.238Z + created_at: 2023-10-20T01:10:28.238Z created_by: username: elastic email: null diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/find_case_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/find_case_response.yaml index 6f744d03a1365d..4c7448c12a9ab1 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/find_case_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/find_case_response.yaml @@ -16,24 +16,39 @@ value: "description": "Case description", "settings": { "syncAlerts": true }, "owner": "cases", + "customFields": [ + { + "type": "text", + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "value": "My field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": null + } + ], "duration": null, "severity": "low", "closed_at": null, "closed_by": null, - "created_at": "2022-05-12T00:16:36.371Z", + "created_at": "2023-10-12T00:16:36.371Z", "created_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "status": "open", - "updated_at": "2022-05-12T00:27:58.162Z", + "updated_at": "2023-10-12T00:27:58.162Z", "updated_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "assignees": [], + "category": null, "connector": { "id": "none", "name": "none", diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_activity_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_activity_response.yaml deleted file mode 100644 index 3cdafb4b26ef89..00000000000000 --- a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_activity_response.yaml +++ /dev/null @@ -1,72 +0,0 @@ -summary: Retrieves all activity for a case -value: - - action_id: b4cd0770-07c9-11ed-a5fd-47154cb8767e - action: create - case_id: 22df07d0-03b1-11ed-920c-974bfa104448 - comment_id: 578608d0-03b1-11ed-920c-974bfa104448 - created_at: 2022-07-20T01:17:22.150Z - created_by: - username: elastic - email: null - full_name: null - owner: cases - payload: - assignees: - connector: - name: none - type: .none - fields: null - id: none - description: test - tags: - - mine - title: test-case - owner: cases - settings: - syncAlerts: false - severity: low - status: open - type: create_case - type: comment - - action_id: 57af14a0-03b1-11ed-920c-974bfa104448 - action: create - case_id: 22df07d0-03b1-11ed-920c-974bfa104448 - comment_id: 578608d0-03b1-11ed-920c-974bfa104448 - created_at: 2022-07-14T20:12:53.354Z - created_by: - username: elastic - email: null - full_name: null - owner: cases - payload: - comment: A new comment - owner: cases - type: user - type: comment - - action_id: 573c6980-6123-11ed-aa41-81a0a61fe447 - action: add - case_id: 22df07d0-03b1-11ed-920c-974bfa104448 - comment_id: null - created_at: 2022-07-20T01:10:28.238Z - created_by: - username: elastic - email: null - full_name: null - profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 - owner: cases - payload: - assignees: - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 - type: assignees - - action_id: fff460e0-07c9-11ed-a5fd-47154cb8767e - action: delete - case_id: 22df07d0-03b1-11ed-920c-974bfa104448 - comment_id: null - created_at: 2022-07-20T01:19:28.238Z - created_by: - username: elastic - email: null - full_name: null - owner: cases - payload: - type: delete_case \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml index f9ba65bd5f7978..8b9197600917f1 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml @@ -4,7 +4,7 @@ value: closure_type: close-by-user customFields: - key: d312efda-ec2b-42ec-9e2c-84981795c581 - label: my-field + label: my-text-field required: false type: text owner: cases diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_response.yaml index bd74fa423bb9c5..d4fc3db97a169a 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_response.yaml @@ -9,11 +9,12 @@ value: "type":"user", "owner":"cases", "comment":"A new comment", - "created_at":"2022-07-13T15:40:32.335Z", + "created_at":"2023-10-13T15:40:32.335Z", "created_by":{ "email":null, "full_name":null, - "username":"elastic" + "username":"elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "pushed_at":null, "pushed_by":null, @@ -26,15 +27,38 @@ value: "tags":["tag 1"], "settings":{"syncAlerts":true}, "owner":"cases", + "customFields": [ + { + "type": "text", + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "value": "My field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": null + } + ], "description":"A case description", "duration":null, "severity":"low", "closed_at":null, "closed_by":null, - "created_at":"2022-07-13T15:33:50.604Z", - "created_by":{"username":"elastic","email":null,"full_name":null},"status":"open", - "updated_at":"2022-07-13T15:40:32.335Z", - "updated_by":{"full_name":null,"email":null,"username":"elastic"}, + "created_at":"2023-10-13T15:33:50.604Z", + "created_by":{ + "username":"elastic", + "email":null, + "full_name":null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" + }, + "status":"open", + "updated_at":"2023-10-13T15:40:32.335Z", + "updated_by":{ + "full_name":null, + "email":null, + "username":"elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" + }, "assignees":[{"uid":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"}], "connector":{ "id":"none", diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/get_comment_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/get_comment_response.yaml index dd2baedd8eda35..8a022ae7d7503a 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/get_comment_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/get_comment_response.yaml @@ -6,11 +6,12 @@ value: "type":"user", "owner":"cases", "comment":"A new comment", - "created_at":"2022-07-07T19:32:13.104Z", + "created_at":"2023-10-07T19:32:13.104Z", "created_by":{ "email":null, "full_name":null, - "username":"elastic" + "username":"elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "pushed_at":null, "pushed_by":null, diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/get_reporters_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/get_reporters_response.yaml index 3651f31c97d6bf..f68df281fb5094 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/get_reporters_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/get_reporters_response.yaml @@ -1,7 +1,16 @@ -summary: A list of three users that opened cases +summary: A list of two users that opened cases value: [ - {"username":"elastic","full_name":null,"email":null}, - {"username":"user1","full_name":"User 1","email":"user1@elastic.co"}, - {"username":"user2","full_name":"User 2","email":"user2@elastic.co"} + { + "username":"elastic", + "full_name":null, + "email":null, + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" + }, + { + "username":"jdoe", + "full_name":"Jane Doe", + "email":"jdoe@example.com", + "profile_uid": "u_0wpfV1MqYDaXzLtRVY-gLMrddKDEmfz51Fszhj7hWC8_0" + } ] \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/get_status_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/get_status_response.yaml deleted file mode 100644 index 8a3883fe928730..00000000000000 --- a/x-pack/plugins/cases/docs/openapi/components/examples/get_status_response.yaml +++ /dev/null @@ -1,7 +0,0 @@ -summary: Get the number of cases in each state. -value: - { - "count_open_cases": 27, - "count_in_progress_cases": 50, - "count_closed_cases": 198 - } \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_request.yaml index 4aa5a56b1ad0fe..472a33d9feacbc 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_request.yaml @@ -6,4 +6,9 @@ value: name: my-jira-connector type: .jira fields: null - closure_type: close-by-user \ No newline at end of file + closure_type: close-by-user + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + required: false + type: text \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml index ceea5eb533e73d..d5a9f7205e23db 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml @@ -1,13 +1,18 @@ -summary: This is an example response when the case configuration was updated. +summary: This is an example response for case settings. value: closure_type: close-by-user - customFields: [] + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + required: false + type: text owner: cases created_at: 2023-10-01T17:07:17.767Z created_by: username: elastic email: null, full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 updated_at: null updated_by: null connector: diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_request.yaml new file mode 100644 index 00000000000000..83d617b17946b1 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_request.yaml @@ -0,0 +1,18 @@ +summary: Update the case settings. +value: + version: WzExOSw0XQ== + connector: + id: 5e656730-e1ca-11ec-be9b-9b1838238ee6 + name: my-jira-connector + type: .jira + fields: null + closure_type: close-by-user + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + required: true + type: text + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + label: my-toggle + required: false + type: toggle \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_response.yaml new file mode 100644 index 00000000000000..6dd1da4d6f1f10 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_response.yaml @@ -0,0 +1,43 @@ +summary: This is an example response when the case configuration was updated. +value: + closure_type: close-by-user + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + label: my-text-field + required: true + type: text + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + label: my-toggle + required: false + type: toggle + owner: cases + created_at: 2023-10-01T17:07:17.767Z + created_by: + username: elastic + email: null, + full_name: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + updated_at: 2023-10-19T00:52:42.401Z + updated_by: + username: elastic + full_name: null + email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + connector: + id: 5e656730-e1ca-11ec-be9b-9b1838238ee6 + name: my-jira-connector + type: .jira + fields: null + mappings: + - source: title + target: summary + action_type: overwrite + - source: description + target: description + action_type: overwrite + - source: comments + target: comments + action_type: append + version: zEzNSw1XQ== + error: null + id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_request.yaml index 0cc85214566701..948227a85ee6d1 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_request.yaml @@ -19,7 +19,19 @@ value: "tags": [ "tag-1" ], "settings": { "syncAlerts": true - } + }, + "customFields": [ + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": false + }, + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "My new field value" + } + ] } ] -} \ No newline at end of file + } \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_response.yaml index eaf421771b51e9..7a40d9a3a7cf90 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_response.yaml @@ -18,20 +18,35 @@ value: "severity": "low", "closed_at": null, "closed_by": null, - "created_at": "2022-05-13T09:16:17.416Z", + "created_at": "2023-10-13T09:16:17.416Z", "created_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "status": "open", - "updated_at": "2022-05-13T09:48:33.043Z", + "updated_at": "2023-10-13T09:48:33.043Z", "updated_by": { "email": null, "full_name": null, - "username": "elastic" + "username": "elastic", + "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, "assignees": [], + "category": null, + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "My new field value" + }, + { + "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", + "type": "toggle", + "value": false + } + ], "connector": { "id": "131d4448-abe0-4789-939d-8ef60680b498", "name": "My connector", @@ -50,7 +65,7 @@ value: "username": "elastic" }, "external_url": "https://hms.atlassian.net/browse/IS-4", - "pushed_at": "2022-05-13T09:20:40.672Z", + "pushed_at": "2023-10-13T09:20:40.672Z", "connector_id": "05da469f-1fde-4058-99a3-91e4807e2de8", "external_id": "10003", "connector_name": "Jira" diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/update_comment_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/update_comment_response.yaml index 4c81e759a92f98..bbd32c3b1e9fd7 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/update_comment_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/update_comment_response.yaml @@ -6,18 +6,20 @@ value: comment: An updated comment. type: user owner: cases - created_at: '2022-03-24T00:37:10.832Z' + created_at: '2023-10-24T00:37:10.832Z' created_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 pushed_at: null pushed_by: null - updated_at: '2022-03-24T01:27:06.210Z' + updated_at: '2023-10-24T01:27:06.210Z' updated_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 totalAlerts: 0 id: 293f1bc0-74f6-11ea-b83a-553aecdb28b6 version: WzIwNjM2LDFd @@ -29,21 +31,32 @@ value: settings: syncAlerts: false owner: cases + category: null + assignees: [] + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: My new field value + - key: fcc6840d-eb14-42df-8aaf-232201a705ec + type: toggle + value: false duration: null severity: low closed_at: null closed_by: null - created_at: '2022-03-24T00:37:03.906Z' + created_at: '2023-10-24T00:37:03.906Z' created_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 status: open - updated_at: '2022-03-24T01:27:06.210Z' + updated_at: '2023-10-24T01:27:06.210Z' updated_by: username: elastic full_name: null email: null + profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 connector: id: none name: none diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml index cda4361ab4cc4f..7b98954476b138 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml @@ -25,6 +25,10 @@ required: properties: assignees: $ref: 'assignees.yaml' + category: + type: string + description: The case category. + nullable: true closed_at: type: string format: date-time @@ -60,6 +64,8 @@ properties: example: '2022-05-13T09:16:17.416Z' created_by: $ref: 'case_response_created_by_properties.yaml' + customFields: + $ref: 'customfields.yaml' description: type: string example: A case description. diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml index 7b3d8d8219ff79..6da0061280dd36 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml @@ -39,7 +39,7 @@ properties: type: string maxLength: 256 category: - description: Category for the case. It could be a word or a phrase to categorize the case. + description: A word or phrase that categorizes the case. type: string maxLength: 50 title: @@ -47,4 +47,4 @@ properties: type: string maxLength: 160 customFields: - $ref: 'custom_fields_property.yaml' + $ref: 'customfields.yaml' diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml deleted file mode 100644 index bc26e871a799da..00000000000000 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/custom_fields_property.yaml +++ /dev/null @@ -1,34 +0,0 @@ -type: array -description: Values for custom fields of a case. -x-technical-preview: true -minItems: 0 -maxItems: 5 -items: - type: object - required: - - key - - type - - field - properties: - key: - description: The key identifying the custom field. - type: string - type: - description: > - The type of the custom field. - It should match the key and how the custom field was configured. - type: string - field: - description: An object containing the value of the field. - type: object - required: - - value - properties: - value: - description: The value of the field. - nullable: true - type: array - items: - anyOf: - - type: string - - type: boolean diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/customfields.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/customfields.yaml new file mode 100644 index 00000000000000..6691bdac9da0fd --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/customfields.yaml @@ -0,0 +1,27 @@ +type: array +description: Custom field values for a case. +x-technical-preview: true +# minItems: 0 +# maxItems: 5 +items: + type: object + required: + - key + - type + - value + properties: + key: + description: The unique identifier for the custom field. + type: string + type: + description: The custom field type. + type: string + enum: + - text + - toggle + value: + description: The custom field value. + oneOf: + - type: string + - type: boolean + nullable: true diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml index 23f9636ef20900..a49a61ec10ba19 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml @@ -18,6 +18,10 @@ properties: properties: assignees: $ref: 'assignees.yaml' + category: + description: A word or phrase that categorizes the case. + type: string + maxLength: 50 connector: oneOf: - $ref: 'connector_properties_none.yaml' @@ -28,7 +32,7 @@ properties: - $ref: 'connector_properties_servicenow_sir.yaml' - $ref: 'connector_properties_swimlane.yaml' customFields: - $ref: 'custom_fields_property.yaml' + $ref: 'customfields.yaml' description: description: An updated description for the case. type: string @@ -49,10 +53,6 @@ properties: items: type: string maxLength: 256 - category: - description: Category for the case. It could be a word or a phrase to categorize the case. - type: string - maxLength: 50 title: description: A title for the case. type: string diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml index 63e10fc5624248..d31299128b076f 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml @@ -16,17 +16,21 @@ patch: application/json: schema: $ref: '../components/schemas/update_case_configuration_request.yaml' + examples: + updateCaseConfigurationRequest: + $ref: '../components/examples/update_case_configuration_request.yaml' responses: '200': description: Indicates a successful call. content: application/json: schema: - type: array - items: - type: object - properties: - $ref: '../components/schemas/case_configure_response_properties.yaml' + type: object + properties: + $ref: '../components/schemas/case_configure_response_properties.yaml' + examples: + updateCaseConfigurationResponse: + $ref: '../components/examples/update_case_configuration_response.yaml' '401': description: Authorization information is missing or invalid. content: diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@status.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@status.yaml index ab6cde8d05475c..cd0792b7b3174e 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@status.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@status.yaml @@ -25,9 +25,6 @@ get: type: integer count_open_cases: type: integer - examples: - getStatusResponse: - $ref: '../components/examples/get_status_response.yaml' '401': description: Authorization information is missing or invalid. content: diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions.yaml index 9bb67097e62e01..83657ecc123b3a 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@{caseid}@user_actions.yaml @@ -20,9 +20,6 @@ get: type: array items: $ref: '../components/schemas/user_actions_response_properties.yaml' - examples: - getCaseActivityResponse: - $ref: '../components/examples/get_case_activity_response.yaml' '401': description: Authorization information is missing or invalid. content: diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml index a874c54564313b..c8656181aca937 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml @@ -18,17 +18,21 @@ patch: application/json: schema: $ref: '../components/schemas/update_case_configuration_request.yaml' + examples: + updateCaseConfigurationRequest: + $ref: '../components/examples/update_case_configuration_request.yaml' responses: '200': description: Indicates a successful call. content: application/json: schema: - type: array - items: - type: object - properties: - $ref: '../components/schemas/case_configure_response_properties.yaml' + type: object + properties: + $ref: '../components/schemas/case_configure_response_properties.yaml' + examples: + updateCaseConfigurationResponse: + $ref: '../components/examples/update_case_configuration_response.yaml' '401': description: Authorization information is missing or invalid. content: diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@status.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@status.yaml index 90c5747f278b8b..d4a6292e6e0fbd 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@status.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@status.yaml @@ -26,9 +26,6 @@ get: type: integer count_open_cases: type: integer - examples: - getStatusResponse: - $ref: '../components/examples/get_status_response.yaml' '401': description: Authorization information is missing or invalid. content: diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml index 6ec289c15cc66d..0cb3770be5b13b 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@{caseid}@user_actions.yaml @@ -21,9 +21,6 @@ get: type: array items: $ref: '../components/schemas/user_actions_response_properties.yaml' - examples: - getCaseActivityResponse: - $ref: '../components/examples/get_case_activity_response.yaml' '401': description: Authorization information is missing or invalid. content: From 516c021e9386b5279b2d1af9824ccfc3cc5fa777 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 19 Oct 2023 12:21:33 -0700 Subject: [PATCH 4/6] [OAS] Integrate changes from PR#169242 --- .../plugins/cases/docs/openapi/bundled.json | 362 ++++++++++++------ .../plugins/cases/docs/openapi/bundled.yaml | 292 ++++++++++---- .../schemas/case_configure_customfields.yaml | 24 ++ .../case_configure_response_properties.yaml | 16 +- .../components/schemas/case_customfields.yaml | 25 ++ .../schemas/case_response_properties.yaml | 8 +- .../configure_custom_fields_request.yaml | 26 -- .../schemas/create_case_request.yaml | 16 +- .../components/schemas/customfields.yaml | 27 -- .../set_case_configuration_request.yaml | 15 +- .../update_case_configuration_request.yaml | 13 +- .../schemas/update_case_request.yaml | 16 +- .../openapi/paths/api@cases@configure.yaml | 2 +- .../s@{spaceid}@api@cases@configure.yaml | 2 +- 14 files changed, 579 insertions(+), 265 deletions(-) create mode 100644 x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml create mode 100644 x-pack/plugins/cases/docs/openapi/components/schemas/case_customfields.yaml delete mode 100644 x-pack/plugins/cases/docs/openapi/components/schemas/configure_custom_fields_request.yaml delete mode 100644 x-pack/plugins/cases/docs/openapi/components/schemas/customfields.yaml diff --git a/x-pack/plugins/cases/docs/openapi/bundled.json b/x-pack/plugins/cases/docs/openapi/bundled.json index 0d6f95da0fc2cf..afdb562740bc0d 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.json +++ b/x-pack/plugins/cases/docs/openapi/bundled.json @@ -391,15 +391,19 @@ "type": "object", "properties": { "key": { - "description": "The key identifying the custom field.", - "type": "string" + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 }, "label": { - "description": "The custom field label.", - "type": "string" + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required.", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -556,7 +560,7 @@ } }, "post": { - "summary": "Sets external connection details, such as the closure type and default connector for cases in the default space.", + "summary": "Creates a case specific configuration that includes external connection details and custom fields.", "operationId": "setCaseConfigurationDefaultSpace", "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details.\n", "tags": [ @@ -600,15 +604,19 @@ "type": "object", "properties": { "key": { - "description": "The key identifying the custom field.", - "type": "string" + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 }, "label": { - "description": "The custom field label.", - "type": "string" + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required.", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -813,15 +821,19 @@ "type": "object", "properties": { "key": { - "description": "The key identifying the custom field.", - "type": "string" + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 }, "label": { - "description": "The custom field label.", - "type": "string" + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required.", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -2118,15 +2130,19 @@ "type": "object", "properties": { "key": { - "description": "The key identifying the custom field.", - "type": "string" + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 }, "label": { - "description": "The custom field label.", - "type": "string" + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required.", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -2283,7 +2299,7 @@ } }, "post": { - "summary": "Sets external connection details, such as the closure type and default connector for cases.", + "summary": "Creates a case specific configuration that includes external connection details and custom fields.", "operationId": "setCaseConfiguration", "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details.\n", "tags": [ @@ -2330,15 +2346,19 @@ "type": "object", "properties": { "key": { - "description": "The key identifying the custom field.", - "type": "string" + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 }, "label": { - "description": "The custom field label.", - "type": "string" + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required.", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -2546,15 +2566,19 @@ "type": "object", "properties": { "key": { - "description": "The key identifying the custom field.", - "type": "string" + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 }, "label": { - "description": "The custom field label.", - "type": "string" + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required.", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -4367,45 +4391,6 @@ ], "default": "low" }, - "customfields": { - "type": "array", - "description": "Custom field values for a case.", - "x-technical-preview": true, - "items": { - "type": "object", - "required": [ - "key", - "type", - "value" - ], - "properties": { - "key": { - "description": "The unique identifier for the custom field.", - "type": "string" - }, - "type": { - "description": "The custom field type.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - }, - "value": { - "description": "The custom field value.", - "oneOf": [ - { - "type": "string" - }, - { - "type": "boolean", - "nullable": true - } - ] - } - } - } - }, "create_case_request": { "title": "Create case request", "description": "The create case API request body varies depending on the type of connector.", @@ -4481,7 +4466,47 @@ "maxLength": 160 }, "customFields": { - "$ref": "#/components/schemas/customfields" + "type": "array", + "description": "Custom field values for a case. Any optional custom fields that are not specified in the request are set to null.\n", + "x-technical-preview": true, + "minItems": 0, + "maxItems": 10, + "items": { + "type": "object", + "required": [ + "key", + "type", + "value" + ], + "properties": { + "key": { + "description": "The unique identifier for the custom field. The key value must exist in the case configuration settings.\n", + "type": "string" + }, + "type": { + "description": "The custom field type. It must match the type specified in the case configuration settings.\n", + "type": "string", + "enum": [ + "text", + "toggle" + ] + }, + "value": { + "description": "The custom field value. If the custom field is required, it cannot be explicitly set to null. However, for cases that existed when the required custom field was added, the default value stored in Elasticsearch is `undefined`. The value returned in the API and user interface in this case is `null`.\n", + "oneOf": [ + { + "type": "string", + "minLength": 1, + "maxLength": 160, + "nullable": true + }, + { + "type": "boolean" + } + ] + } + } + } } } }, @@ -4963,7 +4988,40 @@ "$ref": "#/components/schemas/case_response_created_by_properties" }, "customFields": { - "$ref": "#/components/schemas/customfields" + "type": "array", + "description": "Custom field values for the case.", + "x-technical-preview": true, + "items": { + "type": "object", + "properties": { + "key": { + "description": "The unique identifier for the custom field. The key value must exist in the case configuration settings.\n", + "type": "string" + }, + "type": { + "description": "The custom field type. It must match the type specified in the case configuration settings.\n", + "type": "string", + "enum": [ + "text", + "toggle" + ] + }, + "value": { + "description": "The custom field value. If the custom field is required, it cannot be explicitly set to null. However, for cases that existed when the required custom field was added, the default value stored in Elasticsearch is `undefined`. The value returned in the API and user interface in this case is `null`.\n", + "oneOf": [ + { + "type": "string", + "minLength": 1, + "maxLength": 160, + "nullable": true + }, + { + "type": "boolean" + } + ] + } + } + } }, "description": { "type": "string", @@ -5100,7 +5158,47 @@ ] }, "customFields": { - "$ref": "#/components/schemas/customfields" + "type": "array", + "description": "Custom field values for a case. Any optional custom fields that are not specified in the request are set to null.\n", + "x-technical-preview": true, + "minItems": 0, + "maxItems": 10, + "items": { + "type": "object", + "required": [ + "key", + "type", + "value" + ], + "properties": { + "key": { + "description": "The unique identifier for the custom field. The key value must exist in the case configuration settings.\n", + "type": "string" + }, + "type": { + "description": "The custom field type. It must match the type specified in the case configuration settings.\n", + "type": "string", + "enum": [ + "text", + "toggle" + ] + }, + "value": { + "description": "The custom field value. If the custom field is required, it cannot be explicitly set to null. However, for cases that existed when the required custom field was added, the default value stored in Elasticsearch is `undefined`. The value returned in the API and user interface in this case is `null`.\n", + "oneOf": [ + { + "type": "string", + "minLength": 1, + "maxLength": 160, + "nullable": true + }, + { + "type": "boolean" + } + ] + } + } + } }, "description": { "description": "An updated description for the case.", @@ -5174,42 +5272,6 @@ ], "example": ".none" }, - "configure_custom_fields_request": { - "type": "array", - "description": "Custom fields case configuration.", - "x-technical-preview": true, - "items": { - "type": "object", - "required": [ - "key", - "label", - "required", - "type" - ], - "properties": { - "key": { - "description": "A unique key for the custom field.", - "type": "string" - }, - "label": { - "description": "The custom field label.", - "type": "string" - }, - "required": { - "description": "Indicates whether the field is required.", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } - }, "set_case_configuration_request": { "title": "Set case configuration request", "description": "External connection details, such as the closure type and default connector for cases.", @@ -5254,7 +5316,46 @@ ] }, "customFields": { - "$ref": "#/components/schemas/configure_custom_fields_request" + "type": "array", + "description": "Custom fields case configuration.", + "x-technical-preview": true, + "minItems": 0, + "maxItems": 10, + "items": { + "type": "object", + "required": [ + "key", + "label", + "required", + "type" + ], + "properties": { + "key": { + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "label": { + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "required": { + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } }, "owner": { "$ref": "#/components/schemas/owners" @@ -5303,7 +5404,44 @@ ] }, "customFields": { - "$ref": "#/components/schemas/configure_custom_fields_request" + "type": "array", + "description": "Custom fields case configuration.", + "x-technical-preview": true, + "items": { + "type": "object", + "required": [ + "key", + "label", + "required", + "type" + ], + "properties": { + "key": { + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "label": { + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "required": { + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } }, "version": { "description": "The version of the connector. To retrieve the version value, use the get configuration API.\n", diff --git a/x-pack/plugins/cases/docs/openapi/bundled.yaml b/x-pack/plugins/cases/docs/openapi/bundled.yaml index cc7f78df14b233..97c7acc5c15488 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.yaml +++ b/x-pack/plugins/cases/docs/openapi/bundled.yaml @@ -236,13 +236,19 @@ paths: type: object properties: key: - description: The key identifying the custom field. + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. type: string + minLength: 1 + maxLength: 36 label: - description: The custom field label. + description: The custom field label that is displayed in the case. type: string + minLength: 1 + maxLength: 50 required: - description: Indicates whether the field is required. + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -349,7 +355,7 @@ paths: schema: $ref: '#/components/schemas/4xx_response' post: - summary: Sets external connection details, such as the closure type and default connector for cases in the default space. + summary: Creates a case specific configuration that includes external connection details and custom fields. operationId: setCaseConfigurationDefaultSpace description: | You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. @@ -383,13 +389,19 @@ paths: type: object properties: key: - description: The key identifying the custom field. + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. type: string + minLength: 1 + maxLength: 36 label: - description: The custom field label. + description: The custom field label that is displayed in the case. type: string + minLength: 1 + maxLength: 50 required: - description: Indicates whether the field is required. + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -532,13 +544,19 @@ paths: type: object properties: key: - description: The key identifying the custom field. + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. type: string + minLength: 1 + maxLength: 36 label: - description: The custom field label. + description: The custom field label that is displayed in the case. type: string + minLength: 1 + maxLength: 50 required: - description: Indicates whether the field is required. + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -1339,13 +1357,19 @@ paths: type: object properties: key: - description: The key identifying the custom field. + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. type: string + minLength: 1 + maxLength: 36 label: - description: The custom field label. + description: The custom field label that is displayed in the case. type: string + minLength: 1 + maxLength: 50 required: - description: Indicates whether the field is required. + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -1452,7 +1476,7 @@ paths: schema: $ref: '#/components/schemas/4xx_response' post: - summary: Sets external connection details, such as the closure type and default connector for cases. + summary: Creates a case specific configuration that includes external connection details and custom fields. operationId: setCaseConfiguration description: | You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. @@ -1487,13 +1511,19 @@ paths: type: object properties: key: - description: The key identifying the custom field. + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. type: string + minLength: 1 + maxLength: 36 label: - description: The custom field label. + description: The custom field label that is displayed in the case. type: string + minLength: 1 + maxLength: 50 required: - description: Indicates whether the field is required. + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -1637,13 +1667,19 @@ paths: type: object properties: key: - description: The key identifying the custom field. + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. type: string + minLength: 1 + maxLength: 36 label: - description: The custom field label. + description: The custom field label that is displayed in the case. type: string + minLength: 1 + maxLength: 50 required: - description: Indicates whether the field is required. + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -2866,32 +2902,6 @@ components: - low - medium default: low - customfields: - type: array - description: Custom field values for a case. - x-technical-preview: true - items: - type: object - required: - - key - - type - - value - properties: - key: - description: The unique identifier for the custom field. - type: string - type: - description: The custom field type. - type: string - enum: - - text - - toggle - value: - description: The custom field value. - oneOf: - - type: string - - type: boolean - nullable: true create_case_request: title: Create case request description: The create case API request body varies depending on the type of connector. @@ -2941,7 +2951,39 @@ components: type: string maxLength: 160 customFields: - $ref: '#/components/schemas/customfields' + type: array + description: | + Custom field values for a case. Any optional custom fields that are not specified in the request are set to null. + x-technical-preview: true + minItems: 0 + maxItems: 10 + items: + type: object + required: + - key + - type + - value + properties: + key: + description: | + The unique identifier for the custom field. The key value must exist in the case configuration settings. + type: string + type: + description: | + The custom field type. It must match the type specified in the case configuration settings. + type: string + enum: + - text + - toggle + value: + description: | + The custom field value. If the custom field is required, it cannot be explicitly set to null. However, for cases that existed when the required custom field was added, the default value stored in Elasticsearch is `undefined`. The value returned in the API and user interface in this case is `null`. + oneOf: + - type: string + minLength: 1 + maxLength: 160 + nullable: true + - type: boolean case_response_closed_by_properties: title: Case response properties for closed_by type: object @@ -3294,7 +3336,32 @@ components: created_by: $ref: '#/components/schemas/case_response_created_by_properties' customFields: - $ref: '#/components/schemas/customfields' + type: array + description: Custom field values for the case. + x-technical-preview: true + items: + type: object + properties: + key: + description: | + The unique identifier for the custom field. The key value must exist in the case configuration settings. + type: string + type: + description: | + The custom field type. It must match the type specified in the case configuration settings. + type: string + enum: + - text + - toggle + value: + description: | + The custom field value. If the custom field is required, it cannot be explicitly set to null. However, for cases that existed when the required custom field was added, the default value stored in Elasticsearch is `undefined`. The value returned in the API and user interface in this case is `null`. + oneOf: + - type: string + minLength: 1 + maxLength: 160 + nullable: true + - type: boolean description: type: string example: A case description. @@ -3387,7 +3454,39 @@ components: - $ref: '#/components/schemas/connector_properties_servicenow_sir' - $ref: '#/components/schemas/connector_properties_swimlane' customFields: - $ref: '#/components/schemas/customfields' + type: array + description: | + Custom field values for a case. Any optional custom fields that are not specified in the request are set to null. + x-technical-preview: true + minItems: 0 + maxItems: 10 + items: + type: object + required: + - key + - type + - value + properties: + key: + description: | + The unique identifier for the custom field. The key value must exist in the case configuration settings. + type: string + type: + description: | + The custom field type. It must match the type specified in the case configuration settings. + type: string + enum: + - text + - toggle + value: + description: | + The custom field value. If the custom field is required, it cannot be explicitly set to null. However, for cases that existed when the required custom field was added, the default value stored in Elasticsearch is `undefined`. The value returned in the API and user interface in this case is `null`. + oneOf: + - type: string + minLength: 1 + maxLength: 160 + nullable: true + - type: boolean description: description: An updated description for the case. type: string @@ -3440,33 +3539,6 @@ components: - .servicenow-sir - .swimlane example: .none - configure_custom_fields_request: - type: array - description: Custom fields case configuration. - x-technical-preview: true - items: - type: object - required: - - key - - label - - required - - type - properties: - key: - description: A unique key for the custom field. - type: string - label: - description: The custom field label. - type: string - required: - description: Indicates whether the field is required. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle set_case_configuration_request: title: Set case configuration request description: External connection details, such as the closure type and default connector for cases. @@ -3502,7 +3574,40 @@ components: - name - type customFields: - $ref: '#/components/schemas/configure_custom_fields_request' + type: array + description: Custom fields case configuration. + x-technical-preview: true + minItems: 0 + maxItems: 10 + items: + type: object + required: + - key + - label + - required + - type + properties: + key: + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 + label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 + required: + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle owner: $ref: '#/components/schemas/owners' update_case_configuration_request: @@ -3538,7 +3643,38 @@ components: - name - type customFields: - $ref: '#/components/schemas/configure_custom_fields_request' + type: array + description: Custom fields case configuration. + x-technical-preview: true + items: + type: object + required: + - key + - label + - required + - type + properties: + key: + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 + label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 + required: + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle version: description: | The version of the connector. To retrieve the version value, use the get configuration API. diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml new file mode 100644 index 00000000000000..e6127e42ed09fc --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml @@ -0,0 +1,24 @@ +key: + description: > + A unique key for the custom field. + Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. + It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 +label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 +required: + description: > + Indicates whether the field is required. + If `false`, the custom field can be set to null when a case is created or updated. + type: boolean +type: + description: The type of the custom field. + type: string + enum: + - text + - toggle \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml index 90604278c38a9b..7fa9d85b268dc8 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml @@ -7,21 +7,7 @@ customFields: items: type: object properties: - key: - description: The key identifying the custom field. - type: string - label: - description: The custom field label. - type: string - required: - description: Indicates whether the field is required. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle + $ref: 'case_configure_customfields.yaml' connector: type: object properties: diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_customfields.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_customfields.yaml new file mode 100644 index 00000000000000..4170833e818cc8 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_customfields.yaml @@ -0,0 +1,25 @@ +key: + description: > + The unique identifier for the custom field. + The key value must exist in the case configuration settings. + type: string +type: + description: > + The custom field type. + It must match the type specified in the case configuration settings. + type: string + enum: + - text + - toggle +value: + description: > + The custom field value. + If the custom field is required, it cannot be explicitly set to null. + However, for cases that existed when the required custom field was added, the default value stored in Elasticsearch is `undefined`. + The value returned in the API and user interface in this case is `null`. + oneOf: + - type: string + minLength: 1 + maxLength: 160 + nullable: true + - type: boolean diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml index 7b98954476b138..60c6520d2f4c3d 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml @@ -65,7 +65,13 @@ properties: created_by: $ref: 'case_response_created_by_properties.yaml' customFields: - $ref: 'customfields.yaml' + type: array + description: Custom field values for the case. + x-technical-preview: true + items: + type: object + properties: + $ref: 'case_customfields.yaml' description: type: string example: A case description. diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/configure_custom_fields_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/configure_custom_fields_request.yaml deleted file mode 100644 index 80eb2a58ad37d8..00000000000000 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/configure_custom_fields_request.yaml +++ /dev/null @@ -1,26 +0,0 @@ -type: array -description: Custom fields case configuration. -x-technical-preview: true -items: - type: object - required: - - key - - label - - required - - type - properties: - key: - description: A unique key for the custom field. - type: string - label: - description: The custom field label. - type: string - required: - description: Indicates whether the field is required. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml index 6da0061280dd36..71d3e036ac94b4 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml @@ -47,4 +47,18 @@ properties: type: string maxLength: 160 customFields: - $ref: 'customfields.yaml' + type: array + description: > + Custom field values for a case. + Any optional custom fields that are not specified in the request are set to null. + x-technical-preview: true + minItems: 0 + maxItems: 10 + items: + type: object + required: + - key + - type + - value + properties: + $ref: 'case_customfields.yaml' diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/customfields.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/customfields.yaml deleted file mode 100644 index 6691bdac9da0fd..00000000000000 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/customfields.yaml +++ /dev/null @@ -1,27 +0,0 @@ -type: array -description: Custom field values for a case. -x-technical-preview: true -# minItems: 0 -# maxItems: 5 -items: - type: object - required: - - key - - type - - value - properties: - key: - description: The unique identifier for the custom field. - type: string - type: - description: The custom field type. - type: string - enum: - - text - - toggle - value: - description: The custom field value. - oneOf: - - type: string - - type: boolean - nullable: true diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml index 170f3a1591473a..043febb36c8b6c 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml @@ -19,6 +19,19 @@ properties: - name - type customFields: - $ref: 'configure_custom_fields_request.yaml' + type: array + description: Custom fields case configuration. + x-technical-preview: true + minItems: 0 + maxItems: 10 + items: + type: object + required: + - key + - label + - required + - type + properties: + $ref: 'case_configure_customfields.yaml' owner: $ref: 'owners.yaml' diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml index 70835fe4dec174..86ba2794ea19d2 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml @@ -17,7 +17,18 @@ properties: - name - type customFields: - $ref: 'configure_custom_fields_request.yaml' + type: array + description: Custom fields case configuration. + x-technical-preview: true + items: + type: object + required: + - key + - label + - required + - type + properties: + $ref: 'case_configure_customfields.yaml' version: description: > The version of the connector. diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml index a49a61ec10ba19..3fa99d40e50026 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml @@ -32,7 +32,21 @@ properties: - $ref: 'connector_properties_servicenow_sir.yaml' - $ref: 'connector_properties_swimlane.yaml' customFields: - $ref: 'customfields.yaml' + type: array + description: > + Custom field values for a case. + Any optional custom fields that are not specified in the request are set to null. + x-technical-preview: true + minItems: 0 + maxItems: 10 + items: + type: object + required: + - key + - type + - value + properties: + $ref: 'case_customfields.yaml' description: description: An updated description for the case. type: string diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml index e457a6239a9c2a..5de3de67182b0c 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml @@ -31,7 +31,7 @@ get: $ref: '../components/schemas/4xx_response.yaml' post: - summary: Sets external connection details, such as the closure type and default connector for cases in the default space. + summary: Creates a case specific configuration that includes external connection details and custom fields. operationId: setCaseConfigurationDefaultSpace description: > You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml index 8844e0a53a960e..d12262379df810 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml @@ -32,7 +32,7 @@ get: $ref: '../components/schemas/4xx_response.yaml' post: - summary: Sets external connection details, such as the closure type and default connector for cases. + summary: Creates a case specific configuration that includes external connection details and custom fields. operationId: setCaseConfiguration description: > You must have `all` privileges for the **Cases** feature in the From 5db4abb6a5f824f232c8780ed1b0d36ae0e3faa0 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 23 Oct 2023 09:37:48 -0700 Subject: [PATCH 5/6] [OAS] Clarified required user properties --- .../plugins/cases/docs/openapi/bundled.json | 85 +++++++++++++++++++ .../plugins/cases/docs/openapi/bundled.yaml | 68 +++++++++++++++ .../alert_comment_response_properties.yaml | 12 +++ .../case_configure_response_properties.yaml | 8 ++ .../openapi/paths/api@cases@reporters.yaml | 4 + .../s@{spaceid}@api@cases@reporters.yaml | 4 + 6 files changed, 181 insertions(+) diff --git a/x-pack/plugins/cases/docs/openapi/bundled.json b/x-pack/plugins/cases/docs/openapi/bundled.json index afdb562740bc0d..ab3d5b456e0950 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.json +++ b/x-pack/plugins/cases/docs/openapi/bundled.json @@ -447,6 +447,11 @@ }, "created_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -509,6 +514,11 @@ }, "updated_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -660,6 +670,11 @@ }, "created_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -722,6 +737,11 @@ }, "updated_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -877,6 +897,11 @@ }, "created_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -939,6 +964,11 @@ }, "updated_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -1012,6 +1042,11 @@ "maxItems": 10000, "items": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -2186,6 +2221,11 @@ }, "created_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -2248,6 +2288,11 @@ }, "updated_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -2402,6 +2447,11 @@ }, "created_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -2464,6 +2514,11 @@ }, "updated_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -2622,6 +2677,11 @@ }, "created_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -2684,6 +2744,11 @@ }, "updated_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -2839,6 +2904,11 @@ "type": "array", "items": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -4559,6 +4629,11 @@ }, "created_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -4600,6 +4675,11 @@ }, "pushed_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", @@ -4652,6 +4732,11 @@ }, "updated_by": { "type": "object", + "required": [ + "email", + "full_name", + "username" + ], "properties": { "email": { "type": "string", diff --git a/x-pack/plugins/cases/docs/openapi/bundled.yaml b/x-pack/plugins/cases/docs/openapi/bundled.yaml index 97c7acc5c15488..53374d6aa1cc08 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.yaml +++ b/x-pack/plugins/cases/docs/openapi/bundled.yaml @@ -279,6 +279,10 @@ paths: example: '2022-06-01T17:07:17.767Z' created_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -325,6 +329,10 @@ paths: example: '2022-06-01T19:58:48.169Z' updated_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -432,6 +440,10 @@ paths: example: '2022-06-01T17:07:17.767Z' created_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -478,6 +490,10 @@ paths: example: '2022-06-01T19:58:48.169Z' updated_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -587,6 +603,10 @@ paths: example: '2022-06-01T17:07:17.767Z' created_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -633,6 +653,10 @@ paths: example: '2022-06-01T19:58:48.169Z' updated_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -682,6 +706,10 @@ paths: maxItems: 10000 items: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -1400,6 +1428,10 @@ paths: example: '2022-06-01T17:07:17.767Z' created_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -1446,6 +1478,10 @@ paths: example: '2022-06-01T19:58:48.169Z' updated_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -1554,6 +1590,10 @@ paths: example: '2022-06-01T17:07:17.767Z' created_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -1600,6 +1640,10 @@ paths: example: '2022-06-01T19:58:48.169Z' updated_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -1710,6 +1754,10 @@ paths: example: '2022-06-01T17:07:17.767Z' created_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -1756,6 +1804,10 @@ paths: example: '2022-06-01T19:58:48.169Z' updated_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -1856,6 +1908,10 @@ paths: type: array items: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -3023,6 +3079,10 @@ components: example: '2022-03-24T02:31:03.210Z' created_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -3054,6 +3114,10 @@ components: nullable: true pushed_by: type: object + required: + - email + - full_name + - username properties: email: type: string @@ -3093,6 +3157,10 @@ components: example: null updated_by: type: object + required: + - email + - full_name + - username properties: email: type: string diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/alert_comment_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/alert_comment_response_properties.yaml index 056abad0a300bf..aa39aad1381a02 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/alert_comment_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/alert_comment_response_properties.yaml @@ -12,6 +12,10 @@ properties: example: 2022-03-24T02:31:03.210Z created_by: type: object + required: + - email + - full_name + - username properties: $ref: 'user_properties.yaml' id: @@ -29,6 +33,10 @@ properties: nullable: true pushed_by: type: object + required: + - email + - full_name + - username properties: $ref: 'user_properties.yaml' nullable: true @@ -47,6 +55,10 @@ properties: example: null updated_by: type: object + required: + - email + - full_name + - username properties: $ref: 'user_properties.yaml' version: diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml index 7fa9d85b268dc8..62bddb7a2597b2 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml @@ -18,6 +18,10 @@ created_at: example: 2022-06-01T17:07:17.767Z created_by: type: object + required: + - email + - full_name + - username properties: $ref: 'user_properties.yaml' error: @@ -50,6 +54,10 @@ updated_at: example: 2022-06-01T19:58:48.169Z updated_by: type: object + required: + - email + - full_name + - username properties: $ref: 'user_properties.yaml' nullable: true diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@reporters.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@reporters.yaml index 8fd5e9a916ea9c..15fca2baef2476 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@reporters.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@reporters.yaml @@ -19,6 +19,10 @@ get: maxItems: 10000 items: type: object + required: + - email + - full_name + - username properties: $ref: '../components/schemas/user_properties.yaml' examples: diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@reporters.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@reporters.yaml index 734ed5fac049a7..b2a3bd11d5c9ce 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@reporters.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@reporters.yaml @@ -23,6 +23,10 @@ get: type: array items: type: object + required: + - email + - full_name + - username properties: $ref: '../components/schemas/user_properties.yaml' examples: From a5f32dd62c3ccc0d5142f046bcf04565d2b6fb04 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 23 Oct 2023 09:52:20 -0700 Subject: [PATCH 6/6] [OAS] Clarified description for required custom field property --- x-pack/plugins/cases/docs/openapi/bundled.json | 16 ++++++++-------- x-pack/plugins/cases/docs/openapi/bundled.yaml | 16 ++++++++-------- .../schemas/case_configure_customfields.yaml | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/cases/docs/openapi/bundled.json b/x-pack/plugins/cases/docs/openapi/bundled.json index ab3d5b456e0950..e0b2171463f985 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.json +++ b/x-pack/plugins/cases/docs/openapi/bundled.json @@ -403,7 +403,7 @@ "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -626,7 +626,7 @@ "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -853,7 +853,7 @@ "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -2177,7 +2177,7 @@ "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -2403,7 +2403,7 @@ "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -2633,7 +2633,7 @@ "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -5428,7 +5428,7 @@ "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", "type": "boolean" }, "type": { @@ -5514,7 +5514,7 @@ "maxLength": 50 }, "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated.\n", + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", "type": "boolean" }, "type": { diff --git a/x-pack/plugins/cases/docs/openapi/bundled.yaml b/x-pack/plugins/cases/docs/openapi/bundled.yaml index 53374d6aa1cc08..96b6bdebaa864a 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.yaml +++ b/x-pack/plugins/cases/docs/openapi/bundled.yaml @@ -248,7 +248,7 @@ paths: maxLength: 50 required: description: | - Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -409,7 +409,7 @@ paths: maxLength: 50 required: description: | - Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -572,7 +572,7 @@ paths: maxLength: 50 required: description: | - Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -1397,7 +1397,7 @@ paths: maxLength: 50 required: description: | - Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -1559,7 +1559,7 @@ paths: maxLength: 50 required: description: | - Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -1723,7 +1723,7 @@ paths: maxLength: 50 required: description: | - Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -3668,7 +3668,7 @@ components: maxLength: 50 required: description: | - Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field. @@ -3735,7 +3735,7 @@ components: maxLength: 50 required: description: | - Indicates whether the field is required. If `false`, the custom field can be set to null when a case is created or updated. + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field. diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml index e6127e42ed09fc..344e17b00617dc 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml @@ -14,7 +14,7 @@ label: required: description: > Indicates whether the field is required. - If `false`, the custom field can be set to null when a case is created or updated. + If `false`, the custom field can be set to null or omitted when a case is created or updated. type: boolean type: description: The type of the custom field.