diff --git a/docs/management/connectors/action-types/cases-webhook.asciidoc b/docs/management/connectors/action-types/cases-webhook.asciidoc index 537bfffb88daa..8610c4593d513 100644 --- a/docs/management/connectors/action-types/cases-webhook.asciidoc +++ b/docs/management/connectors/action-types/cases-webhook.asciidoc @@ -15,10 +15,35 @@ The {webhook-cm} connector uses https://github.com/axios/axios[axios] to send PO === Create connectors in {kib} You can create connectors in *{stack-manage-app} > {connectors-ui}* -or as needed when you're creating a rule. For example: +or as needed when you're creating a rule. +In the first step, you must provide a name for the connector and its authentication details. +For example: [role="screenshot"] -image::management/connectors/images/cases-webhook-connector.gif[{webhook-cm} connector] +image::management/connectors/images/cases-webhook-connector.png[Set authentication details in the {webhook-cm} connector] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. + +In the second step, you must provide the information necessary to create cases in the external system. +For example: + +[role="screenshot"] +image::management/connectors/images/cases-webhook-connector-create-case.png[Add case creation details in the {webhook-cm} connector] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. + +In the third step, you must provide information related to retrieving case details from the external system. +For example: + +[role="screenshot"] +image::management/connectors/images/cases-webhook-connector-get-case.png[Add case retrieval details in the {webhook-cm} connector] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. + +In the fourth step, you must provide information necessary to update cases in the external system. +You can also optionally provide information to add comments to cases. +For example: + +[role="screenshot"] +image::management/connectors/images/cases-webhook-connector-comments.png[Add case update and comment details in the {webhook-cm} connector] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. [float] [[cases-webhook-connector-configuration]] @@ -26,17 +51,20 @@ image::management/connectors/images/cases-webhook-connector.gif[{webhook-cm} con {webhook-cm} connectors have the following configuration properties: -Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing and in the connector list when configuring an action. -Require authentication:: If true, a username and password for login type authentication must be provided. -Username:: Username for HTTP basic authentication. -Password:: Password for HTTP basic authentication. -Headers:: A set of key-value pairs sent as headers with the request URLs for the create case, update case, get case, and create comment methods. -Create case method:: REST API HTTP request method to create a case in the third-party system, either `post`(default), `put`, or `patch`. -Create case URL:: REST API URL to create a case in the third-party system. If you are using the <> setting, make sure the hostname is added to the allowed hosts. -Create case object:: A JSON payload sent to the create case URL to create a case. Use the variable selector to add case data to the payload. Required variables are `case.title` and `case.description`. For example: +Add HTTP header:: +A set of key-value pairs sent as headers with the request URLs for the create case, update case, get case, and create comment methods. + +Create case method:: +The REST API HTTP request method to create a case in the third-party system: `post`(default), `put`, or `patch`. + +Create case object:: +A JSON payload sent to the create case URL to create a case. +Use the variable selector to add case data to the payload. +Required variables are `case.title` and `case.description`. For example: + -[source,json] -- +[source,json] +---- { "fields": { "summary": {{{case.title}}}, @@ -44,39 +72,94 @@ Create case object:: A JSON payload sent to the create case URL to create a case "labels": {{{case.tags}}} } } +---- + +NOTE: Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated in this step. +The JSON is validated after the Mustache variables have been placed when REST method runs. +Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. -- + +Create case response external key:: +The JSON key in the create external case response that contains the case ID. + +Create case URL:: +The REST API URL to create a case in the third-party system. +If you are using the <> setting, make sure the hostname is added to the allowed hosts. + +Create comment method:: +The optional REST API HTTP request method to create a case comment in the third-party system: `post`, `put`(default), or `patch`. + +Create comment object:: +An optional JSON payload sent to the create comment URL to create a case comment. +Use the variable selector to add {kib} cases data to the payload. +The required variable is `case.comment`. For example: + -NOTE: Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated in this step. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. +-- +[source,json] +----- +{ + "body": {{{case.comment}}} +} +----- -Create case response - case ID key:: JSON key in the create case response that contains the external case ID. -Get case URL:: REST API URL to GET case by ID from the third-party system. Use the variable selector to add the external system ID to the URL. If you are using the <> setting, make sure the hostname is added to the allowed hosts. For example: +NOTE: Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated in this step. The JSON is validated once the mustache variables have been placed and when REST method runs. We recommend manually ensuring that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. +-- + +Create comment URL:: +The optional REST API URL to create a case comment by ID in the third-party system. +Use the variable selector to add the external system ID to the URL. +If you are using the <> setting, make sure the hostname is added to the allowed hosts. For example: + [source,text] -- -https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}} +https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment -- -+ -NOTE: Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated in this step. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. -Get case response - title key:: JSON key in get case response that contains the external case title -External case view URL:: URL to view case in the external system. Use the variable selector to add the external system ID or external system title to the URL. For example: +External case view URL:: +The URL to view the case in the external system. +Use the variable selector to add the external system ID or external system title to the URL. For example: + [source,text] -- https://testing-jira.atlassian.net/browse/{{{external.system.title}}} -- -Update case method:: REST API HTTP request method to update the case in the third-party system, either `post`, `put`(default), or `patch`. -Update case URL:: REST API URL to update the case by ID in the third-party system. Use the variable selector to add the external system ID to the URL. If you are using the <> setting, make sure the hostname is added to the allowed hosts. For example: + +Get case response external title key:: +The JSON key in the get external case response that contains the case title. + +Get case URL:: +The REST API URL to GET case by ID from the third-party system. +Use the variable selector to add the external system ID to the URL. +If you are using the <> setting, make sure the hostname is added to the allowed hosts. +For example: + -[source,text] -- -https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}} +[source,text] +---- +https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}} +---- + +NOTE: Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated in this step. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. -- -Update case object:: A JSON payload sent to the update case URL to update the case. Use the variable selector to add Kibana Cases data to the payload. Required variables are `case.title` and `case.description`. For example: +Require authentication:: +If true, a username and password for login type authentication must be provided. + +Password:: +The password for HTTP basic authentication. + +Update case method:: +The REST API HTTP request method to update the case in the third-party system: `post`, `put`(default), or `patch`. + +Update case object:: +A JSON payload sent to the update case URL to update the case. +Use the variable selector to add {{kib}} cases data to the payload. +Required variables are `case.title` and `case.description`. +For example: + -[source,json] -- +[source,json] +------ { "fields": { "summary": {{{case.title}}}, @@ -84,29 +167,25 @@ Update case object:: A JSON payload sent to the update case URL to update the ca "labels": {{{case.tags}}} } } --- -+ -NOTE: Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated in this step. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. +------ -Create comment method:: (Optional) REST API HTTP request method to create a case comment in the third-party system, either `post`, `put`(default), or `patch`. +NOTE: Due to Mustache template variables (which is the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated in this step. +The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid to avoid future validation errors; disregard Mustache variables during your review. +-- -Create comment URL:: (Optional) REST API URL to create a case comment by ID in the third-party system. Use the variable selector to add the external system ID to the URL. If you are using the <> setting, make sure the hostname is added to the allowed hosts. For example: +Update case URL:: +The REST API URL to update the case by ID in the third-party system. +Use the variable selector to add the external system ID to the URL. +If you are using the <> setting, make sure the hostname is added to the allowed hosts. +For example: + [source,text] -- -https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment +https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}} -- -Create comment object:: (Optional) A JSON payload sent to the create comment URL to create a case comment. Use the variable selector to add Kibana Cases data to the payload. The required variable is `case.comment`. For example: -+ -[source,json] --- -{ - "body": {{{case.comment}}} -} --- -+ -NOTE: Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated in this step. The JSON is validated once the mustache variables have been placed and when REST method runs. We recommend manually ensuring that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. +Username:: +The username for HTTP basic authentication. [float] [[cases-webhook-action-configuration]] @@ -120,10 +199,25 @@ image::management/connectors/images/cases-webhook-test.gif[{webhook-cm} params t {webhook-cm} actions have the following configuration properties: -Title:: A title for the issue, which is used for searching the contents of the knowledge base. -Description:: The details about the incident. +Additional comments:: +Additional information for the client, such as how to troubleshoot the issue. + +// Case ID:: TBD + +Description:: +The details about the incident. + Labels:: The labels for the incident. -Additional comments:: Additional information for the client, such as how to troubleshoot the issue. + +// Severity:: TBD + +// Status:: TBD + +//Summary:: TBD + +//Tags:: TBD + +Title:: A title for the issue, which is used for searching the contents of the knowledge base. [float] [[cases-webhook-connector-networking-configuration]] diff --git a/docs/management/connectors/images/cases-webhook-connector-comments.png b/docs/management/connectors/images/cases-webhook-connector-comments.png new file mode 100644 index 0000000000000..fd94d59f51158 Binary files /dev/null and b/docs/management/connectors/images/cases-webhook-connector-comments.png differ diff --git a/docs/management/connectors/images/cases-webhook-connector-create-case.png b/docs/management/connectors/images/cases-webhook-connector-create-case.png new file mode 100644 index 0000000000000..0401264e55a72 Binary files /dev/null and b/docs/management/connectors/images/cases-webhook-connector-create-case.png differ diff --git a/docs/management/connectors/images/cases-webhook-connector-get-case.png b/docs/management/connectors/images/cases-webhook-connector-get-case.png new file mode 100644 index 0000000000000..b280974434661 Binary files /dev/null and b/docs/management/connectors/images/cases-webhook-connector-get-case.png differ diff --git a/docs/management/connectors/images/cases-webhook-connector.gif b/docs/management/connectors/images/cases-webhook-connector.gif deleted file mode 100644 index 4718089d1970c..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-connector.gif and /dev/null differ diff --git a/docs/management/connectors/images/cases-webhook-connector.png b/docs/management/connectors/images/cases-webhook-connector.png new file mode 100644 index 0000000000000..f68c1ba0c295f Binary files /dev/null and b/docs/management/connectors/images/cases-webhook-connector.png differ diff --git a/docs/management/connectors/pre-configured-connectors.asciidoc b/docs/management/connectors/pre-configured-connectors.asciidoc index 3b0a5e3004f83..74f18d0283643 100644 --- a/docs/management/connectors/pre-configured-connectors.asciidoc +++ b/docs/management/connectors/pre-configured-connectors.asciidoc @@ -803,17 +803,17 @@ xpack.actions.preconfigured: hasAuth: true <1> headers: <2> 'content-type': 'application/json' - createIncidentUrl: 'https://testing-jira.atlassian.net/rest/api/2/issue' <3> + createIncidentUrl: 'https://example.com/rest/api/2/issue' <3> createIncidentMethod: 'post' <4> createIncidentJson: '{"fields":{"summary":{{{case.title}}},"description":{{{case.description}}},"labels":{{{case.tags}}}' <5> - getIncidentUrl: 'https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}' <6> + getIncidentUrl: 'https://example.com/rest/api/2/issue/{{{external.system.id}}}' <6> getIncidentResponseExternalTitleKey: 'key' <7> - viewIncidentUrl: 'https://testing-jira.atlassian.net/browse/{{{external.system.title}}}' <8> - updateIncidentUrl: 'https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}' <9> + viewIncidentUrl: 'https://example.com/browse/{{{external.system.title}}}' <8> + updateIncidentUrl: 'https://example.com/rest/api/2/issue/{{{external.system.id}}}' <9> updateIncidentMethod: 'put' <10> updateIncidentJson: '{"fields":{"summary":{{{case.title}}},"description":{{{case.description}}},"labels":{{{case.tags}}}' <11> createCommentMethod: 'post', <12> - createCommentUrl: 'https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment', <13> + createCommentUrl: 'https://example.com/rest/api/2/issue/{{{external.system.id}}}/comment', <13> createCommentJson: '{"body": {{{case.comment}}}}', <14> secrets: user: testuser <15> diff --git a/x-pack/plugins/actions/docs/openapi/bundled.json b/x-pack/plugins/actions/docs/openapi/bundled.json index 635c0e9484192..8a1d43f235ed8 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.json +++ b/x-pack/plugins/actions/docs/openapi/bundled.json @@ -296,6 +296,9 @@ "$ref": "#/components/schemas/run_connector_request" }, "examples": { + "runCasesWebhookConnectorRequest": { + "$ref": "#/components/examples/run_cases_webhook_connector_request" + }, "runEmailConnectorRequest": { "$ref": "#/components/examples/run_email_connector_request" }, @@ -364,6 +367,9 @@ } }, "examples": { + "runCasesWebhookConnectorResponse": { + "$ref": "#/components/examples/run_cases_webhook_connector_response" + }, "runEmailConnectorResponse": { "$ref": "#/components/examples/run_email_connector_response" }, @@ -1566,7 +1572,7 @@ "type": "string", "description": "The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts.\n", "examples": [ - "https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment" + "https://example.com/issue/{{{external.system.id}}}/comment" ] }, "createIncidentJson": { @@ -1600,7 +1606,7 @@ }, "createIncidentResponseKey": { "type": "string", - "description": "The JSON key in the create case response that contains the external case ID." + "description": "The JSON key in the create external case response that contains the case ID." }, "createIncidentUrl": { "type": "string", @@ -1608,13 +1614,13 @@ }, "getIncidentResponseExternalTitleKey": { "type": "string", - "description": "The JSON key in get case response that contains the external case title." + "description": "The JSON key in get external case response that contains the case title." }, "getIncidentUrl": { "type": "string", "description": "The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass.\n", "examples": [ - "https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}" + "https://example.com/issue/{{{external.system.id}}}" ] }, "hasAuth": { @@ -1659,7 +1665,7 @@ "type": "string", "description": "The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts.\n", "examples": [ - "https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}}" + "https://example.com/issue/{{{external.system.ID}}}" ] }, "viewIncidentUrl": { @@ -5678,7 +5684,7 @@ "subAction", "subActionParams" ], - "description": "The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors.", + "description": "The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow SecOps, Swimlane, and Webhook - Case Management connectors.", "properties": { "subAction": { "type": "string", @@ -5738,7 +5744,7 @@ }, "description": { "type": "string", - "description": "The description of the incident for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors." + "description": "The description of the incident for Jira, ServiceNow ITSM, ServiceNow SecOps, Swimlane, and Webhook - Case Management connectors." }, "dest_ip": { "description": "A list of destination IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident.\n", @@ -5758,6 +5764,10 @@ "type": "string", "description": "The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. If present, the incident is updated. Otherwise, a new incident is created.\n" }, + "id": { + "type": "string", + "description": "The external case identifier for Webhook - Case Management connectors." + }, "impact": { "type": "string", "description": "The impact of the incident for ServiceNow ITSM connectors." @@ -5836,6 +5846,10 @@ } ] }, + "status": { + "type": "string", + "description": "The status of the incident for Webhook - Case Management connectors." + }, "subcategory": { "type": "string", "description": "The subcategory of the incident for ServiceNow ITSM and ServiceNow SecOps connectors." @@ -5844,9 +5858,16 @@ "type": "string", "description": "A summary of the incident for Jira connectors." }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of tags for Webhook - Case Management connectors." + }, "title": { "type": "string", - "description": "A title for the incident for Jira connectors. It is used for searching the contents of the knowledge base.\n" + "description": "A title for the incident for Jira and Webhook - Case Management connectors. It is used for searching the contents of the knowledge base.\n" }, "urgency": { "type": "string", @@ -6167,6 +6188,33 @@ } } }, + "run_cases_webhook_connector_request": { + "summary": "Run a Webhook - Case Management connector to create a case.", + "value": { + "params": { + "subAction": "pushToService", + "subActionParams": { + "comments": [ + { + "commentId": 1, + "comment": "A comment about the incident." + } + ], + "incident": { + "title": "Case title", + "description": "Description of the incident.", + "tags": [ + "tag1", + "tag2" + ], + "severity": "low", + "status": "open", + "id": "caseID" + } + } + } + } + }, "run_email_connector_request": { "summary": "Send an email message from an email connector.", "value": { @@ -6270,6 +6318,25 @@ } } }, + "run_cases_webhook_connector_response": { + "summary": "Response from a pushToService action for a Webhook - Case Management connector.", + "value": { + "connector_id": "1824b5b8-c005-4dcc-adac-57f92db46459", + "data": { + "id": 100665, + "title": "TEST-29034", + "url": "https://example.com/browse/TEST-29034", + "pushedDate": "2023-12-05T19:43:36.360Z", + "comments": [ + { + "commentId": 1, + "pushedDate": "2023-12-05T19:43:36.360Z" + } + ] + }, + "status": "ok" + } + }, "run_email_connector_response": { "summary": "Response for sending a message from an email connector.", "value": { diff --git a/x-pack/plugins/actions/docs/openapi/bundled.yaml b/x-pack/plugins/actions/docs/openapi/bundled.yaml index 295b9bfbb0308..47c92db7894f0 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled.yaml +++ b/x-pack/plugins/actions/docs/openapi/bundled.yaml @@ -180,6 +180,8 @@ paths: schema: $ref: '#/components/schemas/run_connector_request' examples: + runCasesWebhookConnectorRequest: + $ref: '#/components/examples/run_cases_webhook_connector_request' runEmailConnectorRequest: $ref: '#/components/examples/run_email_connector_request' runIndexConnectorRequest: @@ -224,6 +226,8 @@ paths: - error - ok examples: + runCasesWebhookConnectorResponse: + $ref: '#/components/examples/run_cases_webhook_connector_response' runEmailConnectorResponse: $ref: '#/components/examples/run_email_connector_response' runIndexConnectorResponse: @@ -1005,7 +1009,7 @@ components: description: | The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment + - https://example.com/issue/{{{external.system.id}}}/comment createIncidentJson: type: string description: | @@ -1029,20 +1033,20 @@ components: default: post createIncidentResponseKey: type: string - description: The JSON key in the create case response that contains the external case ID. + description: The JSON key in the create external case response that contains the case ID. createIncidentUrl: type: string description: | The REST API URL to create a case in the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. getIncidentResponseExternalTitleKey: type: string - description: The JSON key in get case response that contains the external case title. + description: The JSON key in get external case response that contains the case title. getIncidentUrl: type: string description: | The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}} + - https://example.com/issue/{{{external.system.id}}} hasAuth: type: boolean description: If true, a username and password for login type authentication must be provided. @@ -1077,7 +1081,7 @@ components: description: | The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}} + - https://example.com/issue/{{{external.system.ID}}} viewIncidentUrl: type: string description: | @@ -3958,7 +3962,7 @@ components: required: - subAction - subActionParams - description: The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors. + description: The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow SecOps, Swimlane, and Webhook - Case Management connectors. properties: subAction: type: string @@ -4006,7 +4010,7 @@ components: The correlation identifier for the security incident for ServiceNow ITSM and ServiveNow SecOps connectors. Connectors using the same correlation ID are associated with the same ServiceNow incident. This value determines whether a new ServiceNow incident is created or an existing one is updated. Modifying this value is optional; if not modified, the rule ID and alert ID are combined as `{{ruleID}}:{{alert ID}}` to form the correlation ID value in ServiceNow. The maximum character length for this value is 100 characters. NOTE: Using the default configuration of `{{ruleID}}:{{alert ID}}` ensures that ServiceNow creates a separate incident record for every generated alert that uses a unique alert ID. If the rule generates multiple alerts that use the same alert IDs, ServiceNow creates and continually updates a single incident record for the alert. description: type: string - description: The description of the incident for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors. + description: The description of the incident for Jira, ServiceNow ITSM, ServiceNow SecOps, Swimlane, and Webhook - Case Management connectors. dest_ip: description: | A list of destination IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident. @@ -4019,6 +4023,9 @@ components: type: string description: | The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. If present, the incident is updated. Otherwise, a new incident is created. + id: + type: string + description: The external case identifier for Webhook - Case Management connectors. impact: type: string description: The impact of the incident for ServiceNow ITSM connectors. @@ -4069,16 +4076,24 @@ components: - type: array items: type: string + status: + type: string + description: The status of the incident for Webhook - Case Management connectors. subcategory: type: string description: The subcategory of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. summary: type: string description: A summary of the incident for Jira connectors. + tags: + type: array + items: + type: string + description: A list of tags for Webhook - Case Management connectors. title: type: string description: | - A title for the incident for Jira connectors. It is used for searching the contents of the knowledge base. + A title for the incident for Jira and Webhook - Case Management connectors. It is used for searching the contents of the knowledge base. urgency: type: string description: The urgency of the incident for ServiceNow ITSM connectors. @@ -4302,6 +4317,24 @@ components: name: updated-connector config: index: updated-index + run_cases_webhook_connector_request: + summary: Run a Webhook - Case Management connector to create a case. + value: + params: + subAction: pushToService + subActionParams: + comments: + - commentId: 1 + comment: A comment about the incident. + incident: + title: Case title + description: Description of the incident. + tags: + - tag1 + - tag2 + severity: low + status: open + id: caseID run_email_connector_request: summary: Send an email message from an email connector. value: @@ -4367,6 +4400,19 @@ components: caseId: '1000' caseName: Case name description: Description of the incident. + run_cases_webhook_connector_response: + summary: Response from a pushToService action for a Webhook - Case Management connector. + value: + connector_id: 1824b5b8-c005-4dcc-adac-57f92db46459 + data: + id: 100665 + title: TEST-29034 + url: https://example.com/browse/TEST-29034 + pushedDate: '2023-12-05T19:43:36.360Z' + comments: + - commentId: 1 + pushedDate: '2023-12-05T19:43:36.360Z' + status: ok run_email_connector_response: summary: Response for sending a message from an email connector. value: diff --git a/x-pack/plugins/actions/docs/openapi/bundled_serverless.json b/x-pack/plugins/actions/docs/openapi/bundled_serverless.json index 769fdf2d258e9..88ee1043e218d 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled_serverless.json +++ b/x-pack/plugins/actions/docs/openapi/bundled_serverless.json @@ -558,7 +558,7 @@ "type": "string", "description": "The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts.\n", "examples": [ - "https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment" + "https://example.com/issue/{{{external.system.id}}}/comment" ] }, "createIncidentJson": { @@ -592,7 +592,7 @@ }, "createIncidentResponseKey": { "type": "string", - "description": "The JSON key in the create case response that contains the external case ID." + "description": "The JSON key in the create external case response that contains the case ID." }, "createIncidentUrl": { "type": "string", @@ -600,13 +600,13 @@ }, "getIncidentResponseExternalTitleKey": { "type": "string", - "description": "The JSON key in get case response that contains the external case title." + "description": "The JSON key in get external case response that contains the case title." }, "getIncidentUrl": { "type": "string", "description": "The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass.\n", "examples": [ - "https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}" + "https://example.com/issue/{{{external.system.id}}}" ] }, "hasAuth": { @@ -651,7 +651,7 @@ "type": "string", "description": "The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts.\n", "examples": [ - "https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}}" + "https://example.com/issue/{{{external.system.ID}}}" ] }, "viewIncidentUrl": { diff --git a/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml b/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml index 15a9dfb0be293..824a6b9205c75 100644 --- a/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml +++ b/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml @@ -368,7 +368,7 @@ components: description: | The REST API URL to create a case comment by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment + - https://example.com/issue/{{{external.system.id}}}/comment createIncidentJson: type: string description: | @@ -392,20 +392,20 @@ components: default: post createIncidentResponseKey: type: string - description: The JSON key in the create case response that contains the external case ID. + description: The JSON key in the create external case response that contains the case ID. createIncidentUrl: type: string description: | The REST API URL to create a case in the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. getIncidentResponseExternalTitleKey: type: string - description: The JSON key in get case response that contains the external case title. + description: The JSON key in get external case response that contains the case title. getIncidentUrl: type: string description: | The REST API URL to get the case by ID from the third-party system. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. You can use a variable to add the external system ID to the URL. Due to Mustache template variables (the text enclosed in triple braces, for example, `{{{case.title}}}`), the JSON is not validated when you create the connector. The JSON is validated after the Mustache variables have been placed when REST method runs. Manually ensure that the JSON is valid, disregarding the Mustache variables, so the later validation will pass. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}} + - https://example.com/issue/{{{external.system.id}}} hasAuth: type: boolean description: If true, a username and password for login type authentication must be provided. @@ -440,7 +440,7 @@ components: description: | The REST API URL to update the case by ID in the third-party system. You can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}} + - https://example.com/issue/{{{external.system.ID}}} viewIncidentUrl: type: string description: | diff --git a/x-pack/plugins/actions/docs/openapi/components/examples/run_cases_webhook_connector_request.yaml b/x-pack/plugins/actions/docs/openapi/components/examples/run_cases_webhook_connector_request.yaml new file mode 100644 index 0000000000000..6aa80ceecbc08 --- /dev/null +++ b/x-pack/plugins/actions/docs/openapi/components/examples/run_cases_webhook_connector_request.yaml @@ -0,0 +1,17 @@ +summary: Run a Webhook - Case Management connector to create a case. +value: + params: + subAction: pushToService + subActionParams: + comments: + - commentId: 1 + comment: A comment about the incident. + incident: + title: Case title + description: Description of the incident. + tags: + - tag1 + - tag2 + severity: low + status: open + id: caseID \ No newline at end of file diff --git a/x-pack/plugins/actions/docs/openapi/components/examples/run_cases_webhook_connector_response.yaml b/x-pack/plugins/actions/docs/openapi/components/examples/run_cases_webhook_connector_response.yaml new file mode 100644 index 0000000000000..8ed95bc57acd5 --- /dev/null +++ b/x-pack/plugins/actions/docs/openapi/components/examples/run_cases_webhook_connector_response.yaml @@ -0,0 +1,12 @@ +summary: Response from a pushToService action for a Webhook - Case Management connector. +value: + connector_id: 1824b5b8-c005-4dcc-adac-57f92db46459 + data: + id: 100665 + title: TEST-29034 + url: https://example.com/browse/TEST-29034 + pushedDate: 2023-12-05T19:43:36.360Z + comments: + - commentId: 1 + pushedDate: 2023-12-05T19:43:36.360Z + status: ok diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_cases_webhook.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_cases_webhook.yaml index 81c94bd3e8806..da803ba7f3128 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_cases_webhook.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/config_properties_cases_webhook.yaml @@ -42,7 +42,7 @@ properties: are using the `xpack.actions.allowedHosts setting`, add the hostname to the allowed hosts. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment + - https://example.com/issue/{{{external.system.id}}}/comment createIncidentJson: type: string description: > @@ -68,7 +68,7 @@ properties: default: post createIncidentResponseKey: type: string - description: The JSON key in the create case response that contains the external case ID. + description: The JSON key in the create external case response that contains the case ID. createIncidentUrl: type: string description: > @@ -76,7 +76,7 @@ properties: using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. getIncidentResponseExternalTitleKey: type: string - description: The JSON key in get case response that contains the external case title. + description: The JSON key in get external case response that contains the case title. getIncidentUrl: type: string description: > @@ -90,7 +90,7 @@ properties: JSON is valid, disregarding the Mustache variables, so the later validation will pass. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}} + - https://example.com/issue/{{{external.system.id}}} hasAuth: type: boolean description: If true, a username and password for login type authentication must be provided. @@ -130,7 +130,7 @@ properties: can use a variable to add the external system ID to the URL. If you are using the `xpack.actions.allowedHosts` setting, add the hostname to the allowed hosts. examples: - - https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}} + - https://example.com/issue/{{{external.system.ID}}} viewIncidentUrl: type: string description: > diff --git a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_pushtoservice.yaml b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_pushtoservice.yaml index 7692a35b2f05f..567e1adf3dfbb 100644 --- a/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_pushtoservice.yaml +++ b/x-pack/plugins/actions/docs/openapi/components/schemas/run_connector_subaction_pushtoservice.yaml @@ -3,7 +3,7 @@ type: object required: - subAction - subActionParams -description: The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors. +description: The `pushToService` subaction for Jira, ServiceNow ITSM, ServiceNow SecOps, Swimlane, and Webhook - Case Management connectors. properties: subAction: type: string @@ -52,7 +52,7 @@ properties: NOTE: Using the default configuration of `{{ruleID}}:{{alert ID}}` ensures that ServiceNow creates a separate incident record for every generated alert that uses a unique alert ID. If the rule generates multiple alerts that use the same alert IDs, ServiceNow creates and continually updates a single incident record for the alert. description: type: string - description: The description of the incident for Jira, ServiceNow ITSM, ServiceNow SecOps, and Swimlane connectors. + description: The description of the incident for Jira, ServiceNow ITSM, ServiceNow SecOps, Swimlane, and Webhook - Case Management connectors. dest_ip: description: > A list of destination IP addresses related to the security incident for ServiceNow SecOps connectors. The IPs are added as observables to the security incident. @@ -66,6 +66,9 @@ properties: description: > The Jira, ServiceNow ITSM, or ServiceNow SecOps issue identifier. If present, the incident is updated. Otherwise, a new incident is created. + id: + type: string + description: The external case identifier for Webhook - Case Management connectors. impact: type: string description: The impact of the incident for ServiceNow ITSM connectors. @@ -117,16 +120,24 @@ properties: - type: array items: type: string + status: + type: string + description: The status of the incident for Webhook - Case Management connectors. subcategory: type: string description: The subcategory of the incident for ServiceNow ITSM and ServiceNow SecOps connectors. summary: type: string description: A summary of the incident for Jira connectors. + tags: + type: array + items: + type: string + description: A list of tags for Webhook - Case Management connectors. title: type: string description: > - A title for the incident for Jira connectors. + A title for the incident for Jira and Webhook - Case Management connectors. It is used for searching the contents of the knowledge base. urgency: type: string diff --git a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}@_execute.yaml b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}@_execute.yaml index a276f30292daf..e479747700abe 100644 --- a/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}@_execute.yaml +++ b/x-pack/plugins/actions/docs/openapi/paths/api@actions@connector@{connectorid}@_execute.yaml @@ -17,6 +17,8 @@ post: schema: $ref: '../components/schemas/run_connector_request.yaml' examples: + runCasesWebhookConnectorRequest: + $ref: '../components/examples/run_cases_webhook_connector_request.yaml' runEmailConnectorRequest: $ref: '../components/examples/run_email_connector_request.yaml' runIndexConnectorRequest: @@ -61,6 +63,8 @@ post: - error - ok examples: + runCasesWebhookConnectorResponse: + $ref: '../components/examples/run_cases_webhook_connector_response.yaml' runEmailConnectorResponse: $ref: '../components/examples/run_email_connector_response.yaml' runIndexConnectorResponse: diff --git a/x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/translations.ts b/x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/translations.ts index cf5b0a37a06dd..02b45786c362f 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/translations.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/translations.ts @@ -83,7 +83,7 @@ export const GET_INCIDENT_URL_REQUIRED = i18n.translate( export const GET_RESPONSE_EXTERNAL_TITLE_KEY_REQUIRED = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.error.requiredGetIncidentResponseExternalTitleKeyText', { - defaultMessage: 'Get case response external case title key is re quired.', + defaultMessage: 'Get case response external case title key is required.', } ); export const GET_RESPONSE_EXTERNAL_CREATED_KEY_REQUIRED = i18n.translate( @@ -165,21 +165,21 @@ export const DELETE_BUTTON = i18n.translate( export const CREATE_INCIDENT_METHOD = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createIncidentMethodTextFieldLabel', { - defaultMessage: 'Create Case Method', + defaultMessage: 'Create case method', } ); export const CREATE_INCIDENT_URL = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createIncidentUrlTextFieldLabel', { - defaultMessage: 'Create Case URL', + defaultMessage: 'Create case URL', } ); export const CREATE_INCIDENT_JSON = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createIncidentJsonTextFieldLabel', { - defaultMessage: 'Create Case Object', + defaultMessage: 'Create case object', } ); @@ -187,7 +187,7 @@ export const CREATE_INCIDENT_JSON_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createIncidentJsonHelpText', { defaultMessage: - 'JSON object to create case. Use the variable selector to add Cases data to the payload.', + 'JSON object to create a case. Use the variable selector to add cases data to the payload.', } ); @@ -204,14 +204,14 @@ export const CODE_EDITOR = i18n.translate( export const CREATE_INCIDENT_RESPONSE_KEY = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createIncidentResponseKeyTextFieldLabel', { - defaultMessage: 'Create Case Response Case Key', + defaultMessage: 'Create case response external key', } ); export const CREATE_INCIDENT_RESPONSE_KEY_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createIncidentResponseKeyHelpText', { - defaultMessage: 'JSON key in create case response that contains the external case id', + defaultMessage: 'JSON key in the create external case response that contains the case ID', } ); @@ -225,109 +225,109 @@ export const ADD_CASES_VARIABLE = i18n.translate( export const GET_INCIDENT_URL = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.getIncidentUrlTextFieldLabel', { - defaultMessage: 'Get Case URL', + defaultMessage: 'Get case URL', } ); export const GET_INCIDENT_URL_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.getIncidentUrlHelp', { defaultMessage: - 'API URL to GET case details JSON from external system. Use the variable selector to add external system id to the url.', + 'API URL to get case details in JSON format from the external system. Use the variable selector to add the external system ID to the URL.', } ); export const GET_INCIDENT_TITLE_KEY = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.getIncidentResponseExternalTitleKeyTextFieldLabel', { - defaultMessage: 'Get Case Response External Title Key', + defaultMessage: 'Get case response external title key', } ); export const GET_INCIDENT_TITLE_KEY_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.getIncidentResponseExternalTitleKeyHelp', { - defaultMessage: 'JSON key in get case response that contains the external case title', + defaultMessage: 'JSON key in the get external case response that contains the case title', } ); export const EXTERNAL_INCIDENT_VIEW_URL = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.viewIncidentUrlTextFieldLabel', { - defaultMessage: 'External Case View URL', + defaultMessage: 'External case view URL', } ); export const EXTERNAL_INCIDENT_VIEW_URL_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.viewIncidentUrlHelp', { defaultMessage: - 'URL to view case in external system. Use the variable selector to add external system id or external system title to the url.', + 'URL to view a case in the external system. Use the variable selector to add external system ID or external system title to the URL.', } ); export const UPDATE_INCIDENT_METHOD = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.updateIncidentMethodTextFieldLabel', { - defaultMessage: 'Update Case Method', + defaultMessage: 'Update case method', } ); export const UPDATE_INCIDENT_URL = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.updateIncidentUrlTextFieldLabel', { - defaultMessage: 'Update Case URL', + defaultMessage: 'Update case URL', } ); export const UPDATE_INCIDENT_URL_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.updateIncidentUrlHelp', { - defaultMessage: 'API URL to update case.', + defaultMessage: 'API URL to update a case.', } ); export const UPDATE_INCIDENT_JSON = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.updateIncidentJsonTextFieldLabel', { - defaultMessage: 'Update Case Object', + defaultMessage: 'Update case object', } ); export const UPDATE_INCIDENT_JSON_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.updateIncidentJsonHelpl', { defaultMessage: - 'JSON object to update case. Use the variable selector to add Cases data to the payload.', + 'JSON object to update a case. Use the variable selector to add cases data to the payload.', } ); export const CREATE_COMMENT_METHOD = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createCommentMethodTextFieldLabel', { - defaultMessage: 'Create Comment Method', + defaultMessage: 'Create comment method', } ); export const CREATE_COMMENT_URL = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createCommentUrlTextFieldLabel', { - defaultMessage: 'Create Comment URL', + defaultMessage: 'Create comment URL', } ); export const CREATE_COMMENT_URL_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createCommentUrlHelp', { - defaultMessage: 'API URL to add comment to case.', + defaultMessage: 'API URL to add a comment to a case.', } ); export const CREATE_COMMENT_JSON = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createCommentJsonTextFieldLabel', { - defaultMessage: 'Create Comment Object', + defaultMessage: 'Create comment object', } ); export const CREATE_COMMENT_JSON_HELP = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.createCommentJsonHelp', { defaultMessage: - 'JSON object to create a comment. Use the variable selector to add Cases data to the payload.', + 'JSON object to create a comment. Use the variable selector to add cases data to the payload.', } ); @@ -385,7 +385,7 @@ export const STEP_2_DESCRIPTION = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.step2Description', { defaultMessage: - 'Set fields to create the case in the external system. Check your service’s API documentation to understand what fields are required', + 'Set fields to create a case in the external system. Check your service’s API documentation to understand what fields are required.', } ); @@ -397,7 +397,7 @@ export const STEP_3_DESCRIPTION = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.step3Description', { defaultMessage: - 'Set fields to add comments to the case in external system. For some systems, this may be the same method as creating updates in cases. Check your service’s API documentation to understand what fields are required.', + 'Set fields to add comments to a case in the external system. For some systems, this may be the same method as creating updates in cases. Check your service’s API documentation to understand what fields are required.', } ); @@ -413,7 +413,7 @@ export const STEP_4A_DESCRIPTION = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.step4aDescription', { defaultMessage: - 'Set fields to create updates to the case in external system. For some systems, this may be the same method as adding comments to cases.', + 'Set fields to update a case in the external system. For some systems, this may be the same method as adding comments to cases.', } ); @@ -425,7 +425,7 @@ export const STEP_4B_DESCRIPTION = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.step4bDescription', { defaultMessage: - 'Set fields to add comments to the case in external system. For some systems, this may be the same method as creating updates in cases.', + 'Set fields to add comments to a case in the external system. For some systems, this may be the same method as creating updates in cases.', } ); @@ -461,7 +461,7 @@ export const CASE_TAGS_DESC = i18n.translate( export const CASE_ID_DESC = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.caseIdDesc', { - defaultMessage: 'Kibana case id', + defaultMessage: 'Kibana case ID', } ); @@ -489,7 +489,7 @@ export const CASE_COMMENT_DESC = i18n.translate( export const EXTERNAL_ID_DESC = i18n.translate( 'xpack.stackConnectors.components.casesWebhook.externalIdDesc', { - defaultMessage: 'External system id', + defaultMessage: 'External system ID', } ); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/webhook_params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/webhook_params.tsx index 72bd3ea8ea843..89732b01a50da 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/webhook_params.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/cases_webhook/webhook_params.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiCallOut, EuiComboBox, EuiFormRow, EuiSpacer } from '@elastic/eui'; +import { EuiCallOut, EuiComboBox, EuiFormRow, EuiSpacer, EuiText } from '@elastic/eui'; import type { ActionParamsProps } from '@kbn/triggers-actions-ui-plugin/public'; import { TextAreaWithMessageVariables, @@ -114,8 +114,13 @@ const WebhookParamsFields: React.FunctionComponent + Required + + } > { + await pageObjects.common.navigateToApp('connectors'); + await pageObjects.header.waitUntilLoadingHasFinished(); + }); + + it('webhook case management connector screenshots', async () => { + await pageObjects.common.navigateToApp('connectors'); + await pageObjects.header.waitUntilLoadingHasFinished(); + await actions.common.openNewConnectorForm('cases-webhook'); + await testSubjects.setValue('nameInput', 'Webhook Case Management test connector'); + await testSubjects.setValue('webhookUserInput', 'testuser@example.com'); + await testSubjects.setValue('webhookPasswordInput', 'password'); + await commonScreenshots.takeScreenshot('cases-webhook-connector', screenshotDirectories); + await testSubjects.click('casesWebhookNext'); + await testSubjects.setValue('webhookCreateUrlText', 'https://example.com/issue'); + await testSubjects.setValue('webhookCreateIncidentJson', createCaseJson); + await testSubjects.setValue('createIncidentResponseKeyText', 'id'); + await commonScreenshots.takeScreenshot( + 'cases-webhook-connector-create-case', + screenshotDirectories, + 1920, + 1400 + ); + await testSubjects.click('casesWebhookNext'); + await testSubjects.setValue( + 'getIncidentUrlInput', + 'https://example.com/issue/{{{external.system.id}}}' + ); + await testSubjects.setValue('getIncidentResponseExternalTitleKeyText', 'key'); + await testSubjects.setValue( + 'viewIncidentUrlInput', + 'https://example.com/issue/{{{external.system.title}}}' + ); + await commonScreenshots.takeScreenshot( + 'cases-webhook-connector-get-case', + screenshotDirectories, + 1920, + 1400 + ); + await testSubjects.click('casesWebhookNext'); + await testSubjects.setValue( + 'updateIncidentUrlInput', + 'https://example.com/issue/{{{external.system.id}}}' + ); + await testSubjects.setValue('webhookUpdateIncidentJson', createCaseJson); + await testSubjects.setValue('webhookCreateCommentMethodSelect', 'post'); + await testSubjects.setValue( + 'createCommentUrlInput', + 'https://example.com/issue/{{{external.system.id}}}' + ); + await testSubjects.setValue('webhookCreateCommentJson', createCommentJson); + await commonScreenshots.takeScreenshot( + 'cases-webhook-connector-comments', + screenshotDirectories, + 1920, + 1400 + ); + await testSubjects.click('euiFlyoutCloseButton'); + }); + }); +} diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/index.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/index.ts index e706ce6a651fb..d8f0332d455a3 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/index.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/index.ts @@ -55,6 +55,7 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) { loadTestFile(require.resolve('./connectors')); loadTestFile(require.resolve('./bedrock_connector')); + loadTestFile(require.resolve('./cases_webhook_connector')); loadTestFile(require.resolve('./email_connector')); loadTestFile(require.resolve('./generative_ai_connector')); loadTestFile(require.resolve('./index_connector'));