Version 1 (modified by Odd Simon Simonsen, 10 years ago) (diff)

New hack CustomFieldAdminPlugin, created by osimons

Trac Custom Field Admin plugin


This plugin is a Web Admin page for administrating custom fields - adding, modifying and deleting them without editing the trac.ini file directly.

The plugin is developed and tested for Trac 0.10.x (should work on 0.9.x). No plans yet for converting it to 0.11.

This plugin is a cooperation between and, and is made freely available under a BSD license.

Known issues:

  • If your web server runs multiple processes, the other processes will not be able to delete custom fields - see ticket:3833 and ticket:5135 for progress on this issue.

Bugs/Feature Requests

Existing bugs and feature requests for CustomFieldAdminPlugin are here.

If you have any issues, create a new ticket.


Download the zipped source from [download:customfieldadminplugin here].


You can check out CustomFieldAdminPlugin from here using Subversion, or browse the source with Trac.


This plugin requires Web Admin plugin (wiki:WebAdmin).

Enable the plugin in trac.ini:

customfieldadmin.* = enabled

The plugin also has an API that can be called from other code if you need to create or modify custom fields. Here is an interactive session as example:

from trac.env import Environment
from customfieldadmin.api import CustomFields

myenv = Environment('/path/to/env')
mycfcomp = CustomFields(myenv)

# Get Cusom fields (list of dicts)
myfields = mycfcomp.get_custom_fields(myenv)
for item in myfields: print item

# Create a custom field - text box
mycfdict = {                # a template dictionary
    'name': 'test01',       # name of field (alphanumeric only)
    'type': 'text',         # text|checkbox|select|radio|textarea
    'label': 'Test 01',     # description
    'value': 'first test',  # default value for field content
    'options': None,        # options for select and radio types (list, leave first empty for optional)
    'cols': None,           # number of columns for text area
    'rows': None,           # number of rows for text area
    'order': 0 }            # specify sort order for field, 0 for last
mycfcomp.update_custom_field(myenv, mycfdict, create=True)

# Updating
mycfdict['type'] = 'select'
mycfdict['options'] = ['', 'one', 'two', 'three']
mycfdict['value'] = None
mycfcomp.update_custom_field(myenv, mycfdict)

# And deleting an existing custom field
mycfcomp.delete_custom_field(myenv, mycfdict)

Recent Changes

16676 by rjollos on 2017-06-24 03:15:33
TracCustomFieldAdmin 0.2.13: Prevent using reserved field name

Patch by Jun Omae.

Fixes #13220.

14567 by rjollos on 2015-05-04 18:37:40
0.12.2: Fixed regression in [14562]. Refs #12217, #12299.

Only check that custom field doesn't match an existing field when creating the field, not when saving changes to the field.

14563 by rjollos on 2015-04-30 17:11:03
0.2.12: tag_svn_revision is not supported in recent versions of setuptools.


Author: osimons