-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Add duration #130448
[Cases] Add duration #130448
Conversation
const updatedDt = new Date().toISOString(); | ||
const updatedCases = await caseService.patchCases({ | ||
cases: updateCases.map(({ updateReq, originalCase }) => { | ||
// intentionally removing owner from the case so that we don't accidentally allow it to be updated | ||
const { id: caseId, version, owner, ...updateCaseAttributes } = updateReq; | ||
let closedInfo = {}; | ||
if (updateCaseAttributes.status && updateCaseAttributes.status === CaseStatuses.closed) { |
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.
I created a helper function getClosedInfoForUpdate
and move the logic there.
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
|
||
/** | ||
* Duration is the time from the creation of the case to the close of the case in seconds | ||
* If an error occurs or the case has not been close then the duration is set to null |
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.
Nit - not been closed
:)
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Public APIs missing comments
Public APIs missing exports
Page load bundle
Saved Objects .kibana field count
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @cnasikas |
* Migrate duration * Add mapping * Change duration when change status * Add integration tests * Fix tests * Improve tests * PR feedback * Fix test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Migrate duration * Add mapping * Change duration when change status * Add integration tests * Fix tests * Improve tests * PR feedback * Fix test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR adds the
duration
field to a case. The field represents the duration of a case from open to close in seconds. The field is needed to calculate the average response time of a case by doing an average aggregation on it.References: https://github.com/elastic/security-team/issues/2080
Checklist
Delete any items that are not applicable to this PR.
For maintainers