Webhook - Case Management connector and action
editWebhook - Case Management connector and action
editThe Webhook - Case Management connector uses axios to send POST, PUT, and GET requests to a case management RESTful API web service.
Create connectors in Kibana
editYou can create connectors in Stack Management > Connectors or as needed when you’re creating a rule. For example:
Connector configuration
editWebhook - Case Management 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
, orpatch
. - Create case URL
-
REST API URL to create a case in the third-party system. If you are using the
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
andcase.description
. For example:{ "fields": { "summary": {{{case.title}}}, "description": {{{case.description}}}, "labels": {{{case.tags}}} } }
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 - 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
xpack.actions.allowedHosts
setting, make sure the hostname is added to the allowed hosts. For example:https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}
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:
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), orpatch
. - 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
xpack.actions.allowedHosts
setting, make sure the hostname is added to the allowed hosts. For example:https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.ID}}}
- 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
andcase.description
. For example:{ "fields": { "summary": {{{case.title}}}, "description": {{{case.description}}}, "labels": {{{case.tags}}} } }
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), orpatch
. - 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
xpack.actions.allowedHosts
setting, make sure the hostname is added to the allowed hosts. For example:https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment
- 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:{ "body": {{{case.comment}}} }
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 preconfigured connectors
editIf you are running Kibana on-prem, you can define connectors by
adding xpack.actions.preconfigured
settings to your kibana.yml
file.
For example:
xpack.actions.preconfigured: my-case-management-webhook: name: Case Management Webhook Connector actionTypeId: .cases-webhook config: hasAuth: true headers: 'content-type': 'application/json' createIncidentUrl: 'https://testing-jira.atlassian.net/rest/api/2/issue' createIncidentMethod: 'post' createIncidentJson: '{"fields":{"summary":{{{case.title}}},"description":{{{case.description}}},"labels":{{{case.tags}}}' getIncidentUrl: 'https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}' getIncidentResponseExternalTitleKey: 'key' viewIncidentUrl: 'https://testing-jira.atlassian.net/browse/{{{external.system.title}}}' updateIncidentUrl: 'https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}' updateIncidentMethod: 'put' updateIncidentJson: '{"fields":{"summary":{{{case.title}}},"description":{{{case.description}}},"labels":{{{case.tags}}}' createCommentMethod: 'post', createCommentUrl: 'https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment', createCommentJson: '{"body": {{{case.comment}}}}', secrets: user: testuser password: passwordvalue
-
config
-
Defines information for the connector type.
-
hasAuth
-
A boolean that corresponds to Requires authentication. If
true
, this connector will require values foruser
andpassword
inside the secrets configuration. Defaults totrue
. -
headers
-
A
record<string, string>
that corresponds to Headers. -
createIncidentUrl
- A URL string that corresponds to Create Case URL.
-
createIncidentMethod
- A string that corresponds to Create Case Method.
-
createIncidentJson
- A stringified JSON with Mustache variables that corresponds to Create Case JSON.
-
createIncidentResponseKey
- A string from the response body of the create case method that corresponds to the External Service Id.
-
getIncidentUrl
- A URL string with an External Service Id Mustache variable that corresponds to Get Case URL.
-
getIncidentResponseExternalTitleKey
- A string from the response body of the get case method that corresponds to the External Service Title.
-
viewIncidentUrl
- A URL string with either the External Service Id or External Service Title Mustache variable that corresponds to View Case URL.
-
updateIncidentUrl
- A URL string that corresponds to Update Case URL.
-
updateIncidentMethod
- A string that corresponds to Update Case Method.
-
updateIncidentJson
- A stringified JSON with Mustache variables that corresponds to Update Case JSON.
-
createCommentUrl
- A URL string that corresponds to Create Comment URL.
-
createCommentMethod
- A string that corresponds to Create Comment Method.
-
createCommentJson
- A stringified JSON with Mustache variables that corresponds to Create Comment JSON.
-
-
secrets
-
Defines sensitive information for the connector type.
-
user
-
A string that corresponds to User. Required if
hasAuth
is set totrue
. -
password
-
A string that corresponds to Password. Required if
hasAuth
is set totrue
.
-
Test connectors
editYou can test connectors with the run connector API or as you’re creating or editing the connector in Kibana. For example:
Webhook - Case Management 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.
- Labels
- The labels for the incident.
- Additional comments
- Additional information for the client, such as how to troubleshoot the issue.
Connector networking configuration
editUse the action configuration settings to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use xpack.actions.customHostSettings
to set per-host configurations.