-
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
[ResponseOps][Cases] Setting rule info to null for 8.0 #123096
[ResponseOps][Cases] Setting rule info to null for 8.0 #123096
Conversation
@@ -458,3 +461,55 @@ export interface Alert { | |||
signal: Signal; | |||
[key: string]: unknown; | |||
} | |||
|
|||
export const getFirstItem = (items?: string | string[] | null): string | null => { | |||
if (items == 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.
nitpick: this kind of code can be confusing as items
could be undefined and can also be null. I'd recommend the more verbose but clear and type safe way:
if (item === undefined || item === null) {
@elasticmachine merge upstream |
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
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.
Tested by running a 7.16 instance and then upgrading to 8.0. All is working as expected. Thank you so much for the fix and the effort you put into it 🚀
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
This is a manual "backport" of this PR: #123094
This is needed because there are multiple features/refactoring that did not go into 8.0.0 but are currently in 8.1. This will cause the above PR's backport to fail so I manually pulled in the changes file by file 😬
Testing
To test I would attach an alert to the case, then grab the
alertId
and case ID information to use with a postman request like this:You should see the rule's name show up for both alerts and clicking on it should take you to the rule's page.