Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom fields #49

Open
vgwidt opened this issue Jul 26, 2023 · 3 comments
Open

Custom fields #49

vgwidt opened this issue Jul 26, 2023 · 3 comments

Comments

@vgwidt
Copy link
Owner

vgwidt commented Jul 26, 2023

I find myself needing a "Location" field, but adding it as a default field may not be appropriate. I could add it as a toggable field, but I think it might be better to just add custom fields. Either way, we need a system in which the user can customize these values.

Database minimum requirements

Create a table that lists the custom fields:

CREATE TABLE ticket_custom_fields (
    id SERIAL PRIMARY KEY,
    field_name TEXT NOT NULL,
    field_type TEXT NOT NULL, 
    is_select BOOLEAN NOT NULL,
    select_values TEXT[]
);

field_type would allow for type checking (i.e. int, text). is_select would make it a select input only. select_values would be default values. If is_select is false, but there are select_values, it would be a combobox.

Then, we need a table to store the actual field data for each field for each ticket:

CREATE TABLE ticket_custom_field_data (
    id SERIAL PRIMARY KEY,
    ticket_id INTEGER REFERENCES tickets(id) ON DELETE CASCADE,
    custom_field_id INTEGER REFERENCES custom_fields(id) ON DELETE CASCADE,
    field_value TEXT
);

Considerations

  • Display priority should be allowed to be set
  • Allowing for customizing element size may be necessary
  • Should we allow it to be set as a default column in the ticket list, or leave that to user preferences?
  • Should all custom fields be added to the ticket filter section?
  • A lot of care will be needed for type checking and handling of changes or deletions of fields
@vgwidt
Copy link
Owner Author

vgwidt commented Jul 27, 2023

Frontend will require settings routing to be reworked. I'd like to try a nested router for this.

@vgwidt
Copy link
Owner Author

vgwidt commented Jul 28, 2023

Removing is_select in favor of having it being defined by the field_type. Also added order_index.

@vgwidt
Copy link
Owner Author

vgwidt commented Jul 29, 2023

Would the implementation of custom fields affect how tags will be implemented? I like the idea of having both so that the user can choose what is appropriate. If tags had two levels (like Bookstack), it could eliminate the need for custom fields, but it would have to be implemented in a way that it could be shown as columns, filtered, and added to reports. So should we stick to adding custom fields then a more simple tag system like that of Github? Tags could still have subtags in this case, but without adding support for columns, reports, etc..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant