Provide custom fields programmatically

Description

The CustomFieldProviderPlugin provides an ​extension point that is used to populate custom fields programmatically. Plugins may implement the ICustomFieldProvider interface and have their custom ticket fields registered.

Download

Source

Example

See the SampleCustomFieldProvider in example.py​ for an example. Documentation on how to use the interface is in interface.py​:

"""
interface to programatically provide custom ticket fields
"""fromtrac.coreimport Interface
classICustomFieldProvider(Interface):deffields():"""
should return a dictionary of dictionaries describing the custom
fields. The primary key should be the field name. The secondary keys
should be the options and the secondary values should be field values
Example:
{ 'mycustomfield': { 'type': 'radio',
'label': 'My Custom Field',
'options': ['foo', 'bar', 'baz']} }
'type' == 'text' is assumed if not provided
See http://trac.edgewall.org/wiki/TracTicketsCustomFields
for defined semantics
"""