User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


Custom Rules Requirements (Alternative to Custom Field Display Requirements)

  • Author: Daryn Warriner (daryn)
  • Status: Work in progress, Draft
  • Associated Issue: #5650, #4736, #5744


Current Approach

Mantis allows for creation of custom field definitions for bugs. Currently, Mantis allows users to configure when each custom field is displayed and when it is required. The current implementation allows the user to specify the display/require option on 4 conditions; report, update, resolved, closed. The report, resolved, and closed conditions each map to one Status. The update conditions maps to all other statuses.

Proposed Approach

This feature allows advanced configuration of custom fields by providing the ability to define complex custom rules using any standard field which is in scope, any custom field, or any configured values. In addition, users are able to apply these custom rules to standard fields and custom fields alike.

The feature allows administrators to set custom permission levels depending on the page the field is on.

For example, management wants a custom field to be required when opening a bug.  However, after the bug is opened
that field should only be editable by a manager.  In this case, the rule for the field on the bug_report and 
bug_report_advanced page is that all users have write permissions to the field and the field is required.  The rule 
for the field on all other update pages is that all users have read permissions but only management users have write permissions.  

Standard permissions rules are applied as the default. Custom permissions are used to override standard field permissions.

Phase 1

Expand the ability to display/require custom fields on specific pages

Phase 2

Implementation Notes

  • Some notes

Database Changes

  • Create Table mantis_config_actions_table
    • id int(11) primary key, with auto_increment flag
    • action varchar(32) NOT NULL unique key
    • description varchar(256)
  • Create Table mantis_config_pages_table
    • id int(11) primary key, with auto_increment flag
    • name varchar(30) NOT NULL
    • page_type enum('BUG','BUGNOTE','USER','PROJECT') NOT NULL default 'BUG'
    • access_type enum('view','add','edit') NOT NULL default 'view'
    • UNIQUE KEY `name` (`name`,`page_type`)
  • Create Table mantis_field_rule_config_table
    • id int(11) primary key, with auto_increment flag
    • config_type enum('custom_field','config','mantis_object') NOT NULL,
    • config_object_type enum('bug','bugnote','user','project') default NULL
    • field_name varchar(75) NOT NULL,
    • field_type enum('string','int','time')
  • Create Table mantis_field_rule_definition_table
    • id int(11) primary key, with auto_increment flag
    • rule_config_id int(11) NOT NULL,
    • comparison_operator enum('==','>','<','⇐','!=') NOT NULL,
    • comparison_value varchar(75) NOT NULL,
  • Create Table mantis_field_rule_link_table
    • id int(11) primary key, with auto_increment flag
    • page_id int(11) NOT NULL,
    • field_id int(11) NOT NULL default '0',
    • field_name varchar(64) NOT NULL,
    • access_level_r smallint(6) NOT NULL,
    • access_level_rw smallint(6) NOT NULL,
    • UNIQUE KEY `page_id` (`page_id`,`field_id`,`field_name`)
  • Create Table mantis_field_ruleset_action_table
    • rule_link_id int(11) NOT NULL
    • action_id int(11) NOT NULL
    • ruleset_id int(11) NOT NULL default '0'
    • UNIQUE KEY `rule_link_id` (`rule_link_id`,`action_id`,`ruleset_id`)
  • Create Table mantis_field_ruleset_operators_table
    • id int(11) primary key, with auto_increment flag
    • operator enum('&&','||') NOT NULL
  • Create Table mantis_field_ruleset_table
    • ruleset_id` int(11) NOT NULL
    • id int(11) NOT NULL COMMENT
    • type enum('rule','ruleset') NOT NULL
    • PRIMARY KEY (`ruleset_id`,`id`,`type`)


  • $g_var indicates something

Implementation Log

Other Changes


  • Please provide feedback
mantisbt/alternative_custom_field_display_requirements.txt · Last modified: 2008/10/29 04:25 (external edit)