Details
Description
Add custom fields on a per-department basis. Custom fields appear when creating new tickets and may request misc information. Fields may be required, and may need to be stored encrypted.
Along with encryption, we should have a checkbox that says "Delete this data when ticket is closed?".. so for something like sensitive encrypted passwords, the data can be deleted automatically when the ticket is closed.
1/5/22 additional thoughts
Break the New/Edit Department form into 2 tabs. Existing content goes into the "General" tab. Add a new tab called "Custom Fields"
Under the "Custom Fields" tab, custom fields can be created and sorted. Custom fields will then appear when creating a ticket within the department for both clients and staff, unless the field visibility is staff only.
Label (Field name that is displayed)
Description (Field description that is displayed above the field, if provided)
Name (The internal name for the field, perhaps auto-generate this based on the label, as all lower-case, no spaces)
Visibility: (Drop down: Client and Staff, Staff Only. Staff will always be able to see fields, clients will only be able to see if this is set to "Client and Staff". If "Client can Add" is NOT checked, staff could add the data, after which the client could see it.)
Type (Field type dropdown, copy from Configurable Options)
Client can Add (Checkbox, client can see the field and submit)
Encrypted? (checkbox, encrypt submitted data if checked. Data will then ONLY be visible to staff, clients will see a message that "This data is encrypted and cannot be displayed" or similar)
Delete Encrypted Field Data on Ticket-Close? (Show if Encrypted is checked. If a ticket is closed, the encrypted field data can be optionally deleted on close. It will then no longer be viewable by staff)
This tab should show a drag-n-drop table of existing fields to sort them, with options to edit and delete, and a [+] button to add a new option. By default there will be no fields, so a form with a message that no fields exist would be shown, and a button in the upper right to create a new field.
We may want to pass custom field data to email templates but not show by default in the emails. Fields that are set to encrypted would not be decrypted for the email so if they were included they would appear as simply the raw encrypted data and be undecipherable.
Custom fields would appear below the drag-n-drop file upload and the "Open Ticket" or "Update Ticket" button, essentially last, in the order displayed.
If a field is deleted, we may want to delete all the data for the field, advising the user that this is what will happen and that if they prefer to just not use the field anymore but keep the data they can change the visibility. When editing a field, if it has been used, do not allow the field "Name" to be changed, as this will probably be used as a key for fetching the field data when viewing the ticket.
A lot of people request, and Blesta 2.x supported a drop down where the affected service could be selected.
Not everyone will want this, so I think it makes sense to add this via a custom field. One of the custom field options when selecting field type (dropdown, checkbox, etc) could be "Service Dropdown", which will automatically render a dropdown with the clients services listed with the label provided for the custom field.