Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cases] Update the custom fields api documentation. #169242

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 105 additions & 26 deletions x-pack/plugins/cases/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,13 @@
"version": {
"type": "string",
"example": "WzIwNzMsMV0="
},
"customFields": {
"description": "An array containing the custom fields in the configuration.",
"type": "array",
"items": {
"$ref": "#/components/schemas/custom_fields_configuration"
}
}
}
}
Expand All @@ -562,7 +569,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": [
Expand Down Expand Up @@ -716,6 +723,13 @@
"version": {
"type": "string",
"example": "WzIwNzMsMV0="
},
"customFields": {
"description": "An array containing the custom fields in the configuration.",
"type": "array",
"items": {
"$ref": "#/components/schemas/custom_fields_configuration"
}
}
}
},
Expand Down Expand Up @@ -906,6 +920,13 @@
"version": {
"type": "string",
"example": "WzIwNzMsMV0="
},
"customFields": {
"description": "An array containing the custom fields in the configuration.",
"type": "array",
"items": {
"$ref": "#/components/schemas/custom_fields_configuration"
}
}
}
}
Expand Down Expand Up @@ -2367,6 +2388,13 @@
"version": {
"type": "string",
"example": "WzIwNzMsMV0="
},
"customFields": {
"description": "An array containing the custom fields in the configuration.",
"type": "array",
"items": {
"$ref": "#/components/schemas/custom_fields_configuration"
}
}
}
}
Expand Down Expand Up @@ -2549,6 +2577,13 @@
"version": {
"type": "string",
"example": "WzIwNzMsMV0="
},
"customFields": {
"description": "An array containing the custom fields in the configuration.",
"type": "array",
"items": {
"$ref": "#/components/schemas/custom_fields_configuration"
}
}
}
},
Expand Down Expand Up @@ -2742,6 +2777,13 @@
"version": {
"type": "string",
"example": "WzIwNzMsMV0="
},
"customFields": {
"description": "An array containing the custom fields in the configuration.",
"type": "array",
"items": {
"$ref": "#/components/schemas/custom_fields_configuration"
}
}
}
}
Expand Down Expand Up @@ -4581,9 +4623,10 @@
},
"custom_fields_property": {
"type": "array",
"description": "Values for custom fields of a case",
"description": "Values for custom fields of a case. Any missing optional custom field(keys) in the request will be set to null.",
"minItems": 0,
"maxItems": 5,
"maxItems": 10,
"x-technical-preview": true,
"items": {
"type": "object",
"required": [
Expand All @@ -4593,36 +4636,31 @@
],
"properties": {
"key": {
"description": "The key identifying the custom field.",
"description": "The key identifying the custom field. Must be unique. Must exist in the configuration.",
"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. Should match the key/type pair in the configuration.",
"enum": [
"text",
"toggle"
],
"type": "string"
},
"field": {
"description": "An object containing the value of the field.",
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"description": "The value of the field.",
"value": {
"anyOf": [
{
"type": "string",
"nullable": true,
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
}
]
}
"minLength": 1,
"maxLength": 160
},
{
"type": "boolean",
"nullable": true
}
}
],
"description": "The value of the custom field. Cannot be explicitly set to null if the field is configured as required. However, existing cases when the custom field was created will have this value null as default.\n"
}
}
}
Expand Down Expand Up @@ -5387,6 +5425,37 @@
],
"example": ".none"
},
"custom_fields_configuration": {
"type": "object",
"description": "An object defining a custom field.",
"x-technical-preview": true,
"properties": {
"key": {
"type": "string",
"description": "Internal identifier for the custom field. Must be lower case and only composed of a-z, 0-9, '_', or '-' characters. Will be used in API calls to refer to this specific custom field. Must be unique.",
"minLength": 1,
"maxLength": 36
},
"label": {
"type": "string",
"minLength": 1,
"maxLength": 50,
"description": "The label used to display the custom field in the Case's pages."
},
"required": {
"type": "boolean",
"description": "Defines if the custom field can be set to null on create/update cases."
},
"type": {
"type": "string",
"enum": [
"text",
"toggle"
],
"description": "The type of the custom field."
}
}
},
"set_case_configuration_request": {
"title": "Set case configuration request",
"description": "External connection details, such as the closure type and default connector for cases.",
Expand Down Expand Up @@ -5446,6 +5515,16 @@
"required": [
"syncAlerts"
]
},
"customFields": {
"description": "An array containing the custom fields.",
"x-technical-preview": true,
"type": "array",
"minItems": 0,
"maxItems": 10,
"items": {
"$ref": "#/components/schemas/custom_fields_configuration"
}
}
}
},
Expand Down
98 changes: 80 additions & 18 deletions x-pack/plugins/cases/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ paths:
version:
type: string
example: WzIwNzMsMV0=
customFields:
description: An array containing the custom fields in the configuration.
type: array
items:
$ref: '#/components/schemas/custom_fields_configuration'
'401':
description: Authorization information is missing or invalid.
content:
Expand All @@ -340,7 +345,7 @@ paths:
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.
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.
Expand Down Expand Up @@ -455,6 +460,11 @@ paths:
version:
type: string
example: WzIwNzMsMV0=
customFields:
description: An array containing the custom fields in the configuration.
type: array
items:
$ref: '#/components/schemas/custom_fields_configuration'
examples:
setCaseConfigResponse:
$ref: '#/components/examples/set_case_configuration_response'
Expand Down Expand Up @@ -585,6 +595,11 @@ paths:
version:
type: string
example: WzIwNzMsMV0=
customFields:
description: An array containing the custom fields in the configuration.
type: array
items:
$ref: '#/components/schemas/custom_fields_configuration'
'401':
description: Authorization information is missing or invalid.
content:
Expand Down Expand Up @@ -1445,6 +1460,11 @@ paths:
version:
type: string
example: WzIwNzMsMV0=
customFields:
description: An array containing the custom fields in the configuration.
type: array
items:
$ref: '#/components/schemas/custom_fields_configuration'
'401':
description: Authorization information is missing or invalid.
content:
Expand Down Expand Up @@ -1570,6 +1590,11 @@ paths:
version:
type: string
example: WzIwNzMsMV0=
customFields:
description: An array containing the custom fields in the configuration.
type: array
items:
$ref: '#/components/schemas/custom_fields_configuration'
examples:
setCaseConfigResponse:
$ref: '#/components/examples/set_case_configuration_response'
Expand Down Expand Up @@ -1701,6 +1726,11 @@ paths:
version:
type: string
example: WzIwNzMsMV0=
customFields:
description: An array containing the custom fields in the configuration.
type: array
items:
$ref: '#/components/schemas/custom_fields_configuration'
'401':
description: Authorization information is missing or invalid.
content:
Expand Down Expand Up @@ -2892,9 +2922,10 @@ components:
default: low
custom_fields_property:
type: array
description: Values for custom fields of a case
description: Values for custom fields of a case. Any missing optional custom field(keys) in the request will be set to null.
minItems: 0
maxItems: 5
maxItems: 10
x-technical-preview: true
items:
type: object
required:
Expand All @@ -2903,25 +2934,24 @@ components:
- field
properties:
key:
description: The key identifying the custom field.
description: The key identifying the custom field. Must be unique. Must exist in the configuration.
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. Should match the key/type pair in the configuration.
enum:
- text
- toggle
type: string
field:
description: An object containing the value of the field.
type: object
required:
- value
properties:
value:
description: The value of the field.
value:
anyOf:
- type: string
nullable: true
type: array
items:
anyOf:
- type: string
- type: boolean
minLength: 1
maxLength: 160
- type: boolean
nullable: true
description: |
The value of the custom field. Cannot be explicitly set to null if the field is configured as required. However, existing cases when the custom field was created will have this value null as default.
create_case_request:
title: Create case request
description: The create case API request body varies depending on the type of connector.
Expand Down Expand Up @@ -3464,6 +3494,30 @@ components:
- .servicenow-sir
- .swimlane
example: .none
custom_fields_configuration:
type: object
description: An object defining a custom field.
x-technical-preview: true
properties:
key:
type: string
description: Internal identifier for the custom field. Must be lower case and only composed of a-z, 0-9, '_', or '-' characters. Will be used in API calls to refer to this specific custom field. Must be unique.
minLength: 1
maxLength: 36
label:
type: string
minLength: 1
maxLength: 50
description: The label used to display the custom field in the Case's pages.
required:
type: boolean
description: Defines if the custom field can be set to null on create/update cases.
type:
type: string
enum:
- text
- toggle
description: The type of the custom field.
set_case_configuration_request:
title: Set case configuration request
description: External connection details, such as the closure type and default connector for cases.
Expand Down Expand Up @@ -3510,6 +3564,14 @@ components:
example: true
required:
- syncAlerts
customFields:
description: An array containing the custom fields.
x-technical-preview: true
type: array
minItems: 0
maxItems: 10
items:
$ref: '#/components/schemas/custom_fields_configuration'
update_case_configuration_request:
title: Update case configuration request
description: External connection details, such as the closure type and default connector for cases.
Expand Down
Loading