#13 closed enhancement (fixed)
Add support for custom ticket fields
| Reported by: | Jonas Borgström | Owned by: | daniel | 
|---|---|---|---|
| Priority: | high | Milestone: | 0.8 | 
| Component: | ticket system | Version: | devel | 
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
It would be nice if custom fields could be added to the tickets by just added a new form items to ticket.cs.
Attachments (1)
Change History (14)
comment:1 by , 22 years ago
| Priority: | high → normal | 
|---|---|
| Version: | → 2.0 | 
comment:2 by , 22 years ago
| Milestone: | → 2.0 | 
|---|---|
| Version: | 2.0 → devel | 
comment:3 by , 22 years ago
| Severity: | normal → enhancement | 
|---|
comment:4 by , 22 years ago
| Milestone: | 2.0 → 0.8 | 
|---|---|
| Priority: | normal → high | 
comment:5 by , 21 years ago
What types of fields can be added? Aside from lists, will there be:
- text
 - text area
 - checkbox
 - multiple selection lists
 - radio button group (2 for yes/no true/false, more for one of many)
 
Having the single selection lists is a great starting point so please don't bump this from 0.8. I just wanted to point out that having more field types would be nice. Also, how will this relate to the report queries?
comment:6 by , 21 years ago
| Owner: | changed from to | 
|---|---|
| Status: | new → assigned | 
comment:7 by , 21 years ago
Initial support commited in [699].
See TracTicketsCustom for sample configuration.
Yet to do:
- 'textarea' type is missing
 - Possibly a snazzier layout of widgets
 - Add static text to 'the yellow part' when viewing a ticket with custom props.
 
comment:8 by , 21 years ago
i get following. maybe a python 2.1 problem ?
Traceback (most recent call last):
  File "/usr/lib/python2.1/site-packages/trac/core.py", line 486, in cgi_start
    real_cgi_start()
  File "/usr/lib/python2.1/site-packages/trac/core.py", line 481, in real_cgi_start
    dispatch_request(path_info, args, req, env, database)
  File "/usr/lib/python2.1/site-packages/trac/core.py", line 391, in dispatch_request
    module.run()
  File "/usr/lib/python2.1/site-packages/trac/Module.py", line 41, in run
    self.render()
  File "/usr/lib/python2.1/site-packages/trac/Ticket.py", line 213, in render
    insert_custom_fields(self.env, self.req.hdf)
  File "/usr/lib/python2.1/site-packages/trac/Ticket.py", line 74, in insert_custom_fields
    cfg = env.get_config_items('ticket-custom')
  File "/usr/lib/python2.1/site-packages/trac/Environment.py", line 185, in get_config_items
    return self.cfg.items(section)
AttributeError: ConfigParser instance has no attribute 'items'
comment:11 by , 21 years ago
attached get_config.item.patch that fixes the AttributeError (warning: im new to python)



  
This is not so difficult, and very useful.
The tricky part is having the ticket forms be dynamic enough to represent arbitrary number of fields. Even that isn't such a big deal really.