Page MenuHomePhabricator

Default empty value for custom "select" field
OpenPublic

Asked by vpavlushkov on Jun 22 2017, 1:01 PM.
Tags
None
Referenced Files
None
Subscribers
Tokens
"Like" token, awarded by mpadourek.

Details

I am trying to customize the forms for tasks creation and editing to match better to the needs of different projects. One of the projects wanted to classify all the tickets based on the values of the new field "Platform". To achieve so, I have added a custom field like that:

...
   "mycompany:Platform": {
      "name": "Platform", 
      "description": "Platform",
      "type": "select", 
      "options": { 
         "mycompany:Web": "Web Client", 
         "mycompany:Android": "Android Client", 
         "mycompany:iOS": "iOS Client" 
      }, 
      "required": false 
   },
...

That works nicely for that project but it turned out that everybody else got affected since the field got auto-added to all the forms. I have marked that field as "Hidden" in the form configurations where it does not belong. That has removed a possibility to modify that field while creating or editing a ticket there BUT it still appears in the resulting ticket since the field value is not empty. I have tried adding one more option "mycompany:Empty": "" but that only changed the string in Details from "Platform: Web client" to "Platform: " but did not remove the field.

How do I specify a default select option in a form to be really empty so that the field does not appear anywhere? I feel it should be pretty simple but could not figure it out. Thanks!