[Cases][Templates] Add DATE_PICKER field control type#260209
Merged
MykhailoKondrat merged 1 commit intoelastic:mainfrom Mar 31, 2026
Merged
[Cases][Templates] Add DATE_PICKER field control type#260209MykhailoKondrat merged 1 commit intoelastic:mainfrom
MykhailoKondrat merged 1 commit intoelastic:mainfrom
Conversation
Contributor
💔 Build Failed
Failed CI Steps
Metrics [docs]
History
|
Contributor
|
Pinging @elastic/kibana-cases (Team:Cases) |
d11c3f9 to
be0a8c8
Compare
lgestc
reviewed
Mar 31, 2026
Comment on lines
+129
to
+132
| .object({ | ||
| show_time: z.boolean().optional(), | ||
| timezone: z.enum(['utc', 'local']).optional(), | ||
| }) |
lgestc
requested changes
Mar 31, 2026
Contributor
lgestc
left a comment
There was a problem hiding this comment.
just one nit about sourcing field type
lgestc
reviewed
Mar 31, 2026
| return i18n.SET_TEMPLATE_FIELD_LABEL(getFieldDisplayName(key), String(value)); | ||
| const displayName = getFieldDisplayName(key); | ||
|
|
||
| if (key.endsWith('AsDate') && typeof value === 'string') { |
Contributor
There was a problem hiding this comment.
we can get exact field type here, based on field definition - no need to guess it based on alias I think
Contributor
Author
There was a problem hiding this comment.
I don't think we have a field definition here - this function is operation over the output of user_actions, not templates entity.
The information about the field we have is limited, and I am not sure we want to to modify user_actions to return more data just to handle this specific case.
{
"type": "create_case",
"payload": {
"connector": {
"id": "none",
"type": ".none",
"fields": null,
"name": "none"
},
"title": "Example template",
"tags": [
"example"
],
"description": "A short description of the template",
"settings": {
"syncAlerts": false,
"extractObservables": false
},
"owner": "observability",
"severity": "low",
"assignees": [],
"status": "open",
"category": "General",
"customFields": []
},
"created_at": "2026-03-31T12:22:20.371Z",
"created_by": {
"username": "elastic",
"full_name": null,
"email": null,
"profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
},
"owner": "observability",
"action": "create",
"comment_id": null,
"id": "d9a7e2d4-a916-4efd-bea0-efa3a1cbf908",
"version": "WzY2LDJd"
},
**{
"payload": {
"extended_fields": {
"start_date_as_date": "2024-01-18T00:00:00.000Z"
}
},
"type": "extended_fields",
"created_at": "2026-03-31T12:22:35.342Z",
"created_by": {
"username": "elastic",
"full_name": null,
"email": null,
"profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
},
"owner": "observability",
"action": "update",
"comment_id": null,
"id": "8a184422-aac2-4c98-a819-9e2bccf0ba16",
"version": "WzY5LDJd"
}**
]```
lgestc
approved these changes
Mar 31, 2026
mbondyra
added a commit
to mbondyra/kibana
that referenced
this pull request
Mar 31, 2026
…hanges * commit 'd0e62a657916e84694a93983e513ce9e34e0b635': (27 commits) [Agent Builder] Agent overview page design updates (elastic#260468) [Inference UI] Add model detail flyout with endpoint management (elastic#260307) [Fleet] Update doc links in agent policy settings (elastic#260245) [Security Solution] show risk score in new flyout header (elastic#260187) Replace deprecated EUI icons in files owned by @elastic/kibana-security (elastic#255636) [Cases][Templates] Add DATE_PICKER field control type (elastic#260209) [SharedUX] Get spaces callout on each solution nav (elastic#259723) [SharedUX] Preserve feature visibility on solution change (elastic#259316) [CI] Increase investigations cypress disks to 110G (elastic#260423) [Agent Builder] Expose read-only conversations on plugin start contract (elastic#260435) [dasboards as code] drop panels with server errors (elastic#260073) [One Workflow] Add force-delete (hard delete) option for workflows (elastic#260391) [Agent Builder] Fix sidebar error handling error (elastic#260446) [Agent Builder] Add attachment origin to Converse API (elastic#259043) [Alerting v2] Fix rule results preview chart responsiveness (elastic#260444) [Streams] Processing error panel UI improvements (elastic#260028) fix flaky test: alert details error page timeout (elastic#260302) [Agent Builder] Add attachment origin to Converse API (elastic#259043) [One Workflow] Add more unit tests to workflows_extensions plugin (elastic#260384) [ResponseOps] Split alerting security_and_spaces group8 FTR config to fix CI timeout (elastic#260029) ...
jeramysoucy
pushed a commit
to jeramysoucy/kibana
that referenced
this pull request
Apr 1, 2026
## What & Why Adds `DATE_PICKER` as a new field control type in the Templates V2 field definition system. Template authors can now include date fields (with optional time selection and UTC/local timezone) in template YAML definitions. The user action timeline renders date values using the locale-aware date formatter instead of a raw ISO string. ## How to Test 1. Navigate to **Cases → Settings → Templates** and open a template for editing. 2. Add a `DATE_PICKER` field to the YAML definition (e.g. `control: DATE_PICKER`, `type: date`). Confirm the live preview renders a date picker input. 3. Set `metadata.show_time: true` — confirm a time selector appears. Set `metadata.timezone: local` — confirm the picker uses local time. 4. Add `validation: required: true` to the field, save the template, open a case using that template, and submit without picking a date — confirm the form blocks submission with an error. 5. Pick a date, save the case, and open the activity timeline — confirm the user action reads "set <field> to <formatted date>" rather than a raw ISO string. ## Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
paulinashakirova
pushed a commit
to paulinashakirova/kibana
that referenced
this pull request
Apr 2, 2026
## What & Why Adds `DATE_PICKER` as a new field control type in the Templates V2 field definition system. Template authors can now include date fields (with optional time selection and UTC/local timezone) in template YAML definitions. The user action timeline renders date values using the locale-aware date formatter instead of a raw ISO string. ## How to Test 1. Navigate to **Cases → Settings → Templates** and open a template for editing. 2. Add a `DATE_PICKER` field to the YAML definition (e.g. `control: DATE_PICKER`, `type: date`). Confirm the live preview renders a date picker input. 3. Set `metadata.show_time: true` — confirm a time selector appears. Set `metadata.timezone: local` — confirm the picker uses local time. 4. Add `validation: required: true` to the field, save the template, open a case using that template, and submit without picking a date — confirm the form blocks submission with an error. 5. Pick a date, save the case, and open the activity timeline — confirm the user action reads "set <field> to <formatted date>" rather than a raw ISO string. ## Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & Why
Adds
DATE_PICKERas a new field control type in the Templates V2 field definition system. Template authors can now include date fields (with optional time selection and UTC/local timezone) in template YAML definitions. The user action timeline renders date values using the locale-aware date formatter instead of a raw ISO string.How to Test
DATE_PICKERfield to the YAML definition (e.g.control: DATE_PICKER,type: date). Confirm the live preview renders a date picker input.metadata.show_time: true— confirm a time selector appears. Setmetadata.timezone: local— confirm the picker uses local time.validation: required: trueto the field, save the template, open a case using that template, and submit without picking a date — confirm the form blocks submission with an error.Checklist
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.