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

[ResponseOps][Alerts] Problem filtering alerts in actions portion of the rules form #192557

Closed
adcoelho opened this issue Sep 11, 2024 · 1 comment · Fixed by #193623
Closed
Labels
bug Fixes for quality problems that affect the customer experience Feature:Alerting/RulesManagement Issues related to the Rules Management UX Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@adcoelho
Copy link
Contributor

Describe the bug:

When defining actions for a rule the filtering area If alert matches a query is not working as expected. We should be able to define either a filter or a KQL query but the form always expects a KQL query. This makes the filters useless/redundant.

Steps to reproduce:

  1. Go to Rules and try creating a new rule of any type
  2. Add an action to the rule
  3. Check the option If alert matches a query
  4. Observe that the error A custom query is required. is displayed before the user interacts with this form section.
  5. Click the plus sign to open the Add a filter tooltip (AlertsSearchBar component)
  6. Add a filter and click Save
  7. Observe that the error A custom query is required. is still displayed, preventing the form from being submitted.

The form can only be submitted if we add a query to the Filter alerts using KQL syntax text box.

Expected behavior:

  1. The error A custom query is required. shouldn't be displayed before the user interacts with the form.
  2. Adding a filter using the tooltip should be an alternative to the KQL option. We should be able to submit the form if either of these is defined.

Screenshots:

Form displaying the error by default

Image

Form with a filter defined but still displaying an error.

Image

Form without errors when a filter and a query are defined.

Image

@adcoelho adcoelho added bug Fixes for quality problems that affect the customer experience Feature:Alerting Feature:Alerting/RulesManagement Issues related to the Rules Management UX Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Sep 11, 2024
@elasticmachine
Copy link
Contributor

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Oct 13, 2024
…3623)

## Summary

Resolves elastic#183908
Resolves elastic#192557

This PR fixes an issue of DSL filter in
<details><summary>Search bar in Alerts page of Stack
management</summary>
<img width="1237" alt="image"
src="https://github.com/user-attachments/assets/b9b380d2-80a7-4754-95f2-6b6831923c4d">
</details>

<details><summary>Search bar in Alerts page of Observability</summary>
<img width="1237" alt="image"
src="https://github.com/user-attachments/assets/68ceb97f-b958-47f4-b356-757cbafd9170">
</details>

<details><summary>Search bar in "If alerts matches query" action
filter</summary>
<img width="1281" alt="image"
src="https://github.com/user-attachments/assets/1f99ca43-c4b5-4f52-b50f-914f1e205c5b">
</details>

<details><summary>Search bar in Maintenance window page</summary>
<img width="1272" alt="image"
src="https://github.com/user-attachments/assets/ffaa317d-c14b-45a2-9d02-00f7a10239ab">
</details>

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### How to verify
- Create a DSL filter in above mentioned pages
- Verify that filter is applied properly

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 122647b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Alerting/RulesManagement Issues related to the Rules Management UX Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants