Ticket #13 (closed enhancement: fixed)
Opened 8 years ago
Last modified 5 years ago
Add support for custom ticket fields
| Reported by: | jonas | Owned by: | daniel |
|---|---|---|---|
| Priority: | high | Milestone: | 0.8 |
| Component: | ticket system | Version: | devel |
| Severity: | normal | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API 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
Change History
comment:1 Changed 8 years ago by daniel
- Priority changed from high to normal
- Version set to 2.0
comment:2 Changed 8 years ago by daniel
- Milestone set to 2.0
- Version changed from 2.0 to devel
comment:3 Changed 8 years ago by daniel
- Severity changed from normal to enhancement
comment:4 Changed 8 years ago by daniel
- Milestone changed from 2.0 to 0.8
- Priority changed from normal to high
comment:5 Changed 8 years ago by anonymous
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 Changed 8 years ago by daniel
- Owner changed from jonas to daniel
- Status changed from new to assigned
comment:7 Changed 8 years ago by daniel
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 Changed 8 years ago by vittorio
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:9 Changed 8 years ago by arnarb@…
I get the same error as vittorio on 2.2
comment:10 Changed 8 years ago by arnarb@…
Python docs say ConfigParser?.items is new since 2.3
Changed 8 years ago by vittorio
- Attachment get_config_items.patch added
fixes AttributeError? for python<2.3
comment:11 Changed 8 years ago by vittorio
attached get_config.item.patch that fixes the AttributeError (warning: im new to python)
comment:12 Changed 8 years ago by daniel
Applied patch in [706]. Thanks a bunch, man :)
comment:13 Changed 8 years ago by daniel
- Resolution set to fixed
- Status changed from assigned to closed
Closed in [714].



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.