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

[8.12] [Connectors][Case Management] Edit labels, automate screenshots (#172610) #175744

Closed
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
182 changes: 138 additions & 44 deletions docs/management/connectors/action-types/cases-webhook.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,98 +15,177 @@ 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]]
==== Connector configuration

{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 <<action-settings,`xpack.actions.allowedHosts`>> 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}}},
"description": {{{case.description}}},
"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 <<action-settings,`xpack.actions.allowedHosts`>> 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 <<action-settings,`xpack.actions.allowedHosts`>> 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 <<action-settings,`xpack.actions.allowedHosts`>> 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 <<action-settings,`xpack.actions.allowedHosts`>> 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 <<action-settings,`xpack.actions.allowedHosts`>> 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}}},
"description": {{{case.description}}},
"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 <<action-settings,`xpack.actions.allowedHosts`>> 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 <<action-settings,`xpack.actions.allowedHosts`>> 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]]
Expand All @@ -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]]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/management/connectors/pre-configured-connectors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading
Loading