[Security Solution] [Cases] Swimlane Connector for Cases#100086
[Security Solution] [Cases] Swimlane Connector for Cases#100086cnasikas merged 119 commits intoelastic:masterfrom
Conversation
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
pmuellr
left a comment
There was a problem hiding this comment.
LGTM - I made a few comments for things that looked like they weren't quite finished, or provide more diagnostic data, and a note about the DX on the SwimlaneMappingConfig type
x-pack/plugins/actions/server/builtin_action_types/swimlane/service.ts
Outdated
Show resolved
Hide resolved
.../alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/swimlane.ts
Show resolved
Hide resolved
x-pack/plugins/cases/public/components/connectors/swimlane/validator.ts
Outdated
Show resolved
Hide resolved
...ins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/types.ts
Outdated
Show resolved
Hide resolved
…ana into field_mapping_connector
jonathan-buttner
left a comment
There was a problem hiding this comment.
Nice work Christos, Steph, and Xavier! I noticed when testing a swimlane connector configured for alerts that it sends over {{rule.name}} and {{alert.id}} (testing through the creation page UI)
The actual values get populated though when a rule runs though:
Mostly just nit comments, and a few questions.
|
|
||
| if (value) { | ||
| switch (fieldType) { | ||
| case 'numeric': { |
There was a problem hiding this comment.
I might have missed them but should we add some tests for this case?
x-pack/plugins/actions/server/builtin_action_types/swimlane/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/actions/server/builtin_action_types/swimlane/service.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/cases/public/components/connectors/swimlane/validator.ts
Outdated
Show resolved
Hide resolved
| validator: ({ value: connectorId }) => { | ||
| const connector = getConnectorById(connectorId as string, connectors); | ||
| if (connector != null) { | ||
| return validators[connector.actionTypeId]?.(connector); |
There was a problem hiding this comment.
nit: we could probably get rid of this if by doing return validators[connector.actionTypeId]?.(connector); and have connectorValidator handle undefined | null as input.
There was a problem hiding this comment.
I think is best to leave the check in a central place. I would like to avoid other developers to wonder what to return if the connector is null. If they return a message it will be a wrong return value.
...ui/public/application/components/builtin_action_types/swimlane/steps/swimlane_connection.tsx
Outdated
Show resolved
Hide resolved
| fullWidth | ||
| helpText={ | ||
| <EuiLink | ||
| href={`${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/swimlane-action-type.html`} |
There was a problem hiding this comment.
Just a note, we need to talk to the docs team to create this right?
There was a problem hiding this comment.
I assume it will be created automatically from docs/management/connectors/action-types/swimlane.asciidoc that is included in this PR.
| [editActionConfig, fieldIdMap, mappings] | ||
| ); | ||
|
|
||
| /** |
There was a problem hiding this comment.
Thanks for the comment!
Hey @jonathan-buttner! This is the expected behaviour. When you test a connector there is no alert created so that's why you get the mustache variables instead of real values. |
…ana into field_mapping_connector
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsasync chunk count
History
To update your PR or re-run it, just comment with: |
…103165) Co-authored-by: Josh <josh.rickard@swimlane.com> Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com> Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co> Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co> Co-authored-by: Josh <josh.rickard@swimlane.com> Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com> Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
|
yayyyy!!! |


Summary
Adapted from an unmerged PR: #95109
Depends on: #101145
Two parter:
.swimlane.swimlaneas a case connector typeSchema
paramspushToService.subActionParams (pushToService){ commentId: string, version: string, comment: string }.The following table describes the properties of the
incidentobject.Cases
'cases-connector-mappings'are saved to map tocaseNamefor title,descriptionfor description andcommentsfor commentscaseName,description, andcommentsScreenshots
List of connectors
Create connector: Instance configuration
Create connector: Mapping configuration
Create connector: Type Alerts
Create connector: Type Cases
Create alert
Error message on cases
Warning message on alerts
Checklist
Delete any items that are not applicable to this PR.