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][WIP] Linked Cases #181018

Open
adcoelho opened this issue Apr 17, 2024 · 2 comments
Open

[Cases][WIP] Linked Cases #181018

adcoelho opened this issue Apr 17, 2024 · 2 comments
Assignees
Labels
Feature:Cases Cases feature Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@adcoelho
Copy link
Contributor

adcoelho commented Apr 17, 2024

Kibana Cases are used for issue investigation and collaborations. To help users in their investigations with cases(reviewing previous cases, researching connected cases) the system needs to allow for defining relationships between cases.

Backend

Mapping

Option 1 - “Array”

linkedCases: {
  type: 'keyword',
},
  • Pros:
    • Faster search?
  • Cons:
    • Every new relationship type will need a new field

Option 2 - Nested field type

linkedCases: {
  type: 'nested',
  properties: {
    caseId: {
      type: 'keyword',
    },
    relationshipType: {
      type: 'keyword',
    },
  },
},
  • Pros:
    • Easier to implement new relationship types
  • Cons:
    • More complex implementation?

API

linkedCases schema

linkedCases: rt.union([
  limitedArraySchema({
    codec: rt.strict({
      caseId: limitedStringSchema({
        fieldName: 'caseID',
        min: CASEID_LENGTH,
        max: CASEID_LENGTH,
      }),
      relationshipType: rt.string, // possibly part of an enum
    }),
    fieldName: 'linkedCases',
    min: 0,
    max: MAX_LINKED_CASES_LENGTH,
  }),
  rt.null,
]),

Create and update Cases

  • The CasePatchRequest will include the new linkedCases field.
  • The CasePostRequestRt will include the new linkedCases field.
  • We will validate the number of linked cases.
  • We can only link cases we have access to.
  • Linking and unlinking a case will update the “other” case with the same/reverse relationship.
  • We cannot link multiple times the same case with the same relationship
  • What if the current case has not reached the limit but we try to link a case that reached the MAX_LINKED_CASES ?

GET Cases

  • Should now return the linkedCases field.

Delete Case

  • Do we need to delete the relationships in all linked cases?

Find Cases

Frontend

Displaying linked cases

Screenshot 2024-04-17 at 12 02 39
  • Jira uses sections with lists. Should we use a table with Relationship, Name, etc?
Screenshot 2024-04-17 at 12 36 23
  • An alternative to the design suggestion above would be a new tab with linked cases where this table would be shown alone.
Screenshot 2024-04-17 at 12 41 22
  • We use the bulkGet API to get all related cases by ID.
  • Do we just display the name? Name and relationship? What else?
  • Clicking a linked case leads to its detail page.
  • What happens when a linked case is deleted? Is it still shown? We won’t have access to the name.
  • Design?

Linking cases

Screenshot 2024-04-17 at 12 00 44
  • Two pages with similar behavior:
    • Case Detail
    • Create Case
Screenshot 2024-04-17 at 12 12 20
  • Search by case name with autocomplete.
    • Search also by id?
    • A case cannot be linked to itself.
  • Linking a case should be logged in the activity feed.
  • Limit the number of linked cases
Screenshot 2024-04-17 at 12 00 51
  • Do we want multiple relationship types?
    • Selectbox with possible relationships?
  • Bulk linking cases? Next release?

Cases table

  • Filtering by linked cases
@adcoelho adcoelho added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature labels Apr 17, 2024
@adcoelho adcoelho self-assigned this Apr 17, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Cases Cases feature Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

No branches or pull requests

2 participants