wiki:TicketFieldFilterPlugin

Filter ticket fields depending on ticket type and user permissions

Description

This is a plugin to filter ticket fields depending on the ticket type and user permissions. It also allows you to set fields to read-only to prevent modification. When doing so the field is no longer part of the Modify section, but will still be shown in the ticket header.

Configuration is done in the admin section.

See also CondFieldsGenshiPlugin, DynamicFieldsPlugin

Screenshot of ticket field administration page

Bugs/Feature Requests

Existing bugs and feature requests for TicketFieldFilterPlugin are here.

If you have any issues, create a new ticket.

defect

3 / 4

enhancement

1 / 1

Download

Download the zipped source from here.

Source

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

Installation

General instructions on installing Trac plugins can be found on the TracPlugins page.

Enable the plugin in your trac.ini file:

[components]
ticketfieldfilter.* = enabled

Configuration

The configuration can be changed using the Ticket Fields admin page in the Ticket section.

For each ticket type you may set:

  • Which fields to show at all.
  • If a shown field is read-only. Read-only fields don't show up in the Modify section.
  • A permission for a field. If the user doesn't have the necessary permission, the field is removed.

Note that permissions only apply to fields which are enabled at all for the ticket type.

Each entry in trac.ini starts with the ticket type:

[ticket-field-filter]
<type>.fields = component, cc, type, ...
<type>.readonly = component, cc, ...
<type>.permission = component: PERM_1 | TICKET_CREATE, cc: PERM_2, ...

Leaving the entry <type>.fields empty disables all fields for the ticket type. Removing the entry completely enables all fields. Another way is to specify +:

[ticket-field-filter]
# enable all fields for ticket type 'defect'
defect.fields = +

Note that the following fields can't be removed from the ticket page:

time, changetime, attachment

If the permission entry is missing or left empty, then no permission check takes place.

You may specify a list of fields which are always shown:

[ticket-field-filter]
required_fields = summary, reporter, owner, description, status, type, cc

Default is: summary, reporter, owner, description, status.

Recent Changes

18107 by Cinc-th on 2021-03-29 12:23:42
TicketFieldFilterPlugin: no longer use Javascript for read-nly field handling. Trac provides a variable field['editable'] just for that.

Closes #13988

18103 by Cinc-th on 2021-03-26 18:42:22
TicketFieldFilterPlugin: fixed saving of permissions for ticket fields. Internal data was not correct when processing the save from the admin page resulting in missing information.

Closes #13985

18102 by Cinc-th on 2021-03-26 16:26:38
TicketFieldFilterPlugin: add classifiers to setup.py. Fix for Python 3 problem. The plugin does work with Trac 1.5 (and probably Trac 1.6) now.
(more)

Author/Contributors

Author: Cinc-th
Maintainer: Cinc-th
Contributors:

Last modified 5 months ago Last modified on Apr 19, 2021, 4:58:40 AM

Attachments (1)

Download all attachments as: .zip