kibana/x-pack/test
Janki Salvi a56227bf37
[ResponseOps][Rules] Allow to set notify when and throttle at rule level (#203235)
## Summary

Fixes https://github.com/elastic/kibana/issues/199494

This PR allows to create and update rule with `notify_when` and
`throttle` attributes at rule level instead of `action.frequency` level.

### How to test
- create a rule via api where `notify_when` and `throttle` attributes
are at rule level
  <details><summary>Example</summary>
  Note: use your existing connector for action
  
  ```typescript
  POST kbn:/api/alerting/rule
  {
    "tags": [],
    "params": {
      "searchConfiguration": {
        "query": {
          "query": "",
          "language": "kuery"
        },
        "index": "ff959d40-b880-11e8-a6d9-e546fe2bba5f"
      },
      "timeField": "order_date",
      "searchType": "searchSource",
      "timeWindowSize": 5,
      "timeWindowUnit": "d",
      "threshold": [
        10
      ],
      "thresholdComparator": ">",
      "size": 100,
      "aggType": "count",
      "groupBy": "all",
      "termSize": 5,
      "excludeHitsFromPreviousRun": false,
      "sourceFields": []
    },
    "schedule": {
      "interval": "1m"
    },
    "consumer": "stackAlerts",
    "name": "ES query rule from devtools",
    "rule_type_id": ".es-query",
    "notify_when": "onThrottleInterval",
    "throttle": "1h",
    "actions": [
      {
        "group": "query matched",
        "id": "ad923c8a-d27d-41a9-8c71-d33d94db4abb",
        "params": {
          "documents": [
            {
              "name": "{{rule.name}}"
            }
          ]
        }
      }
    ],
    "alert_delay": {
      "active": 1
    }
  }
  ``` 
  </details> 

- open the created rule
- go to `settings` tab 
- verify that dropdowns reflect notify_when and throttle value correctly
- update the rule via UI and verify the same
- update the rule via API and verify the same

### Flaky test runner: 
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7684

### Checklist

Check the PR satisfies following conditions. 

- [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
2025-01-09 16:18:28 +00:00
..
accessibility [Search] Remove Enterprise Search UI Apps (#205634) 2025-01-09 15:55:18 +01:00
alerting_api_integration Add ".reindexed-v8-" prefix to the valid prefixes list (#204819) 2025-01-07 21:50:52 +01:00
api_integration 🌊 Streams: Show data retention on stream (#204125) 2025-01-09 09:25:19 +01:00
api_integration_basic [Cases] [Security Solution] New cases subfeatures, add comments and reopen cases (#194898) 2024-11-19 13:15:38 -06:00
apm_api_integration [ResponseOps][Rules] Move APM rule types params to the @kbn/response-ops-rule-params package (#204637) 2025-01-03 10:07:46 +00:00
automatic_import_api_integration [Automatic Import] Add more FTR tests (#203772) 2024-12-12 05:58:59 +01:00
banners_functional
cases_api_integration split case api integration security and spaces config_trial 2025-01-07 15:59:05 +02:00
cloud_integration Clean up cloud_chat (#194571) 2024-10-03 13:37:47 +02:00
cloud_security_posture_api [Cloud Security] Update graph appearance (#204610) 2024-12-19 08:50:39 -06:00
cloud_security_posture_functional [Cloud Security] Added investigate in timeline to graph investigation (#205264) 2025-01-06 16:51:05 +00:00
common [Streams] Dashboard linking (#204309) 2025-01-07 21:04:42 +00:00
custom_branding [SharedUX] Replace Sass with Emotion, Round 1 (#199885) 2024-12-04 10:39:22 -07:00
dataset_quality_api_integration [Dataset Quality] Move /integrations/{id}/dashboards API Integration test to Deployment Agnostic (#205256) 2025-01-08 11:31:16 +01:00
defend_workflows_cypress [Security Solution] Removing cypress folder (#197273) 2024-10-24 17:26:33 +02:00
disable_ems
encrypted_saved_objects_api_integration [ESO] Add flag to allow ESO consumers to opt-out of highly random UIDs (#198287) 2024-11-05 15:40:53 +01:00
examples [ON-WEEK][POC] Playwright (#190803) 2024-09-06 13:09:18 +02:00
fleet_api_integration [ci] Use daily promoted EPR distribution (#205221) 2025-01-06 14:08:27 -06:00
fleet_cypress [Fleet] Add cypress test against space awareness (#195372) 2024-10-11 09:19:21 +02:00
fleet_functional [Fleet] Fix failing/flaky tests (#189559) 2024-07-31 14:14:30 -04:00
fleet_packages [Fleet] Remove deprecated Symantec package from install_all_packages_job (#193029) 2024-09-17 11:35:00 +02:00
ftr_apis Authorized route migration for routes owned by @elastic/kibana-core (#198187) 2024-11-07 16:48:30 -08:00
functional [Dashboard] Add functional test for panel listing types (#205808) 2025-01-09 08:37:29 -05:00
functional_basic [ML] Functional tests - cleanMlIndices without system index access (#199653) 2024-11-22 17:54:01 +01:00
functional_cloud [Theme] configure appearance color mode (#203406) 2024-12-30 09:43:48 +00:00
functional_cors Remove deprecated abab package (#183383) 2024-05-16 12:48:26 +02:00
functional_embedded
functional_enterprise_search Sustainable Kibana Architecture: Move modules owned by @elastic/search-kibana (#202837) 2024-12-27 10:55:21 -06:00
functional_execution_context [ResponseOps][Alerting] Decouple feature IDs from consumers (#183756) 2024-12-03 12:21:53 +02:00
functional_gen_ai/inference GenAI FTR tests: switch to daily job (#203369) 2024-12-09 16:09:29 +01:00
functional_search test(search): fix flakey solution nav (#204275) 2024-12-16 09:50:54 -06:00
functional_solution_sidenav [Stateful sidenav] Enable on-prem (#203239) 2024-12-11 13:12:15 +00:00
functional_with_es_ssl [ResponseOps][Rules] Allow to set notify when and throttle at rule level (#203235) 2025-01-09 16:18:28 +00:00
kubernetes_security [Http] Gracefully onboarding internal routes to VersionedRouter (#194789) 2024-10-04 08:47:36 +02:00
licensing_plugin Skip test due to unavailable resource (#195330) 2024-10-08 02:38:56 +02:00
load [ON-WEEK][POC] Playwright (#190803) 2024-09-06 13:09:18 +02:00
localization [Lens] speed up functional test suite by setting the time picker via ui settings (#199479) 2024-11-12 17:40:47 +01:00
monitoring_api_integration Fix typo in stack monitoring apm (#187875) 2024-07-10 14:50:47 +01:00
observability_ai_assistant_api_integration [Obs AI Assistant] Unskip user instructions test (#205656) (#205897) 2025-01-09 10:01:15 -05:00
observability_ai_assistant_functional [Observability AI Assistant] migrate to inference client #197630 (#199286) 2024-12-09 12:46:31 +01:00
observability_api_integration [Obs AI Assistant] Add security configs to API (#201439) 2024-11-28 12:20:31 -05:00
observability_functional [Embeddable] Avoid rerendering loop due to search context reload (#203150) 2024-12-11 16:03:36 +01:00
observability_onboarding_api_integration [Onboarding] Remove System Logs onboarding flow (#196132) 2024-10-17 14:41:10 +02:00
osquery_cypress [Security Solution] Removing cypress folder (#197273) 2024-10-24 17:26:33 +02:00
plugin_api_integration [Stack Connectors][Microsoft Defender] Adds new connector for Microsoft Defender for Endpoint (#203183) 2025-01-07 10:25:27 -05:00
plugin_api_perf Add @typescript-eslint/no-floating-promises (#181456) 2024-05-01 08:41:31 -07:00
plugin_functional [ON-WEEK][POC] Playwright (#190803) 2024-09-06 13:09:18 +02:00
profiling_api_integration [FTR] Refactor test/common/services/* -> packages/kbn-ftr-common-functional-[ui-]services/* (#191805) 2024-09-05 10:00:55 +01:00
reporting_api_integration [Reporting] Functional tests for privileges with built-in reporting_user (#205827) 2025-01-08 08:20:08 -07:00
reporting_functional [Reporting] Use Kibana feature privileges only to control access to reporting (#200834) 2024-12-04 09:51:29 -07:00
rule_registry [ResponseOps][Rules] Delete legacy routes (#203148) 2024-12-16 08:35:28 -06:00
saved_object_api_integration FIPS FTR Overrides and test skips (#192053) 2024-09-10 13:17:40 -04:00
saved_object_tagging [So tagging] Add automatic read privileges for "tag" SO type (#202400) 2024-12-11 12:11:13 +00:00
saved_objects_field_count [FTR] Refactor test/common/services/* -> packages/kbn-ftr-common-functional-[ui-]services/* (#191805) 2024-09-05 10:00:55 +01:00
scalability [ON-WEEK][POC] Playwright (#190803) 2024-09-06 13:09:18 +02:00
screenshot_creation [Observability] add custom threshold functional test (#184602) 2024-09-18 09:56:58 +02:00
search_sessions_integration [Discover] Remove the legacy table (#201254) 2024-12-03 12:03:08 +01:00
security_api_integration [Reporting] Use Kibana feature privileges only to control access to reporting (#200834) 2024-12-04 09:51:29 -07:00
security_functional chore(security, eslint): apply platform security-specific rules to all exclusively owned paths. (#195711) 2024-10-11 09:49:12 +02:00
security_solution_api_integration [Security Solution][Detection Engine] add deprecation warning for non-migrated signals (#204247) 2025-01-08 10:28:35 +00:00
security_solution_cypress Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-visualizations (#202754) 2025-01-08 12:19:24 +01:00
security_solution_endpoint Sustainable Kibana Architecture: Move modules owned by @elastic/security-solution (#202851) 2024-12-16 22:55:27 -06:00
security_solution_ftr [SecuritySolution][Timeline] Refactor timeline HTTP API (#200633) 2024-11-22 07:54:45 +01:00
security_solution_playwright Sustainable Kibana Architecture: Move modules owned by @elastic/security-solution (#202851) 2024-12-16 22:55:27 -06:00
session_view [Cloud Security] add Kibana e2e support for Auditbeat (#179985) 2024-04-16 07:28:09 -07:00
spaces_api_integration [ES body removal] @elastic/kibana-security (#204862) 2024-12-19 14:22:33 +01:00
stack_functional_integration [QA]Change screenshot size for metricbeat dashboard test (#199378) 2024-11-07 17:22:34 -06:00
task_manager_claimer_update_by_query [ResponseOps][Rules] Delete legacy routes (#203148) 2024-12-16 08:35:28 -06:00
ui_capabilities [Synonyms UI] Synonyms UI base plugin (#203284) 2025-01-06 19:15:19 +00:00
upgrade [Dashboard] Remove library and drilldown notifications (#190797) 2024-09-09 14:11:15 -07:00
upgrade_assistant_integration [Upgrade Assistant] Reindexing optimizations (#205055) 2025-01-09 12:37:30 +01:00
usage_collection Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-core (#201653) 2025-01-04 11:47:24 -07:00
kibana.jsonc Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
tsconfig.json [Streams] Dashboard linking (#204309) 2025-01-07 21:04:42 +00:00