fix: prefill template fields with meta default on new ticket page - #3675
fix: prefill template fields with meta default on new ticket page#3675RitvikSardana wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3675 +/- ##
===========================================
- Coverage 71.63% 71.61% -0.02%
===========================================
Files 145 145
Lines 10106 10106
===========================================
- Hits 7239 7237 -2
- Misses 2867 2869 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tick the box to add this pull request to the merge queue (same as
|
Confidence Score: 4/5The Check-default normalization bug should be fixed before merging. A raw Frappe default of Files Needing Attention: desk/src/pages/ticket/TicketNew.vue Reviews (1): Last reviewed commit: "fix: prefill template fields with meta d..." | Re-trigger Greptile |
| function setupTemplateFields(fields) { | ||
| fields.forEach((field: Field) => { | ||
| templateFields[field.fieldname] = ""; | ||
| templateFields[field.fieldname] = field.default || ""; |
There was a problem hiding this comment.
Check defaults invert false values
When a Check field has Frappe's string default "0", this assignment preserves the nonempty string and UniInput treats it as truthy, causing an unchecked field to display “Yes” and submit the wrong value.
Knowledge Base Used: Helpdesk core doctypes: agents, teams, customers, knowledge base, and support config
Template fields on the new ticket page were always initialized empty, ignoring the field's
defaultset in meta (DocField / Custom Field / Property Setter).get_oneAPI now returnsdefaultfor each template fieldTest: set a default on an HD Ticket field via Customize Form, add it to the ticket template, open the new ticket page. The field comes prefilled.
🤖 Generated with Claude Code