-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution][Case][Bug] Removing empty collections when filtering on status #92048
[Security Solution][Case][Bug] Removing empty collections when filtering on status #92048
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
I have a question about calculating the total count for each status (x-pack/plugins/case/server/services/index.ts Line 418). Seems we haven't take empty collections into counts, wondering if there's a way to get the count of empty collections . |
@elasticmachine merge upstream |
Hey Angela, what do we need the count of empty collections for? Currently the backend doesn't provide a count for them. Since collections technically don't have a status anymore we're not including them in the status totals. Empty case collections will be included in the array if the user doesn't filter on status. |
The status filters show open, in-progress and closed counts in the dropdown. Given that we decided not to show counts for status all, no worries about it then. |
@@ -291,10 +294,20 @@ export class CaseService implements CaseServiceSetup { | |||
const subCasesForCase = subCasesResp.subCasesMap.get(caseInfo.id); | |||
|
|||
/** | |||
* This will include empty collections unless the query explicitly requested type === CaseType.individual, in which | |||
* case we'd not have any collections anyway. | |||
* If this case is an individual add it to the return map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome description here, thank you
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…r/kibana into remove-empty-collections
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…ing on status (elastic#92048) * Removing empty collections when not filtering on status * Fixing add comment response Co-authored-by: Kibana Machine <[email protected]>
…ing on status (elastic#92048) * Removing empty collections when not filtering on status * Fixing add comment response Co-authored-by: Kibana Machine <[email protected]>
…ing on status (#92048) (#93097) * Removing empty collections when not filtering on status * Fixing add comment response Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
…ing on status (#92048) (#93096) * Removing empty collections when not filtering on status * Fixing add comment response Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
This PR addresses an issue where empty collections were returned in the
/_find
cases API. Instead we only want to return empty collections if the API request did not include astatus
to filter with. If no status was not included all collections will be returned regardless of whether they have sub cases.Filtering on non status fields should behave the same. For example if we're looking for cases/collections with a particular
tag
this honors that.Issue: #91843