Changes between Version 35 and Version 36 of DynamicFieldsPlugin
- Timestamp:
- Aug 1, 2012, 3:20:16 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DynamicFieldsPlugin
v35 v36 20 20 1. Install the plugin (after downloading and unzipping): 21 21 {{{ 22 #!sh 22 23 cd dynamicfieldsplugin/0.11 23 24 sudo python setup.py bdist_egg … … 29 30 2. Enable the plugin: 30 31 {{{ 32 #!ini 31 33 [components] 32 34 dynfields.* = enabled … … 61 63 Let's say that your team only specifies effort for enhancements, but not for defects or other ticket types. This rule shows a custom {{{effort}}} field only when the {{{type}}} field's value is ''enhancement'': 62 64 {{{ 65 #!ini 63 66 [ticket-custom] 64 67 effort.show_when_type = enhancement … … 67 70 If effort is specified for either enhancement or defect ticket types, then use pipe-delimited syntax to list both of them: 68 71 {{{ 72 #!ini 69 73 [ticket-custom] 70 74 effort.show_when_type = enhancement|defect … … 73 77 If your version field is based upon the milestone, then this rule hides the {{{version}}} field when the {{{milestone}}} field's value is empty: 74 78 {{{ 79 #!ini 75 80 [ticket-custom] 76 81 version.hide_when_milestone = … … 79 84 You may also hide fields based on group membership. For example, if only members of the production team should see a custom {{{duedate}}} field: 80 85 {{{ 86 #!ini 81 87 [ticket-custom] 82 88 duedate.show_if_group = production … … 85 91 Some of your fields may be auto-generated or used by very few people. To always hide a field: 86 92 {{{ 93 #!ini 87 94 [ticket-custom] 88 95 alwayshidden.hide_always = true … … 92 99 Fields that are always hidden will also be hidden on the custom query ({{{/query}}}) page. The {{{clear_on_hide}}} option above specifies that the field's value should not be cleared when hidden (clearing is the default behavior). Sometimes you want to allow users to get access to hidden fields. You can enable specific fields to be shown in ticket views when a user clicks a "Show hidden fields" link: 93 100 {{{ 101 #!ini 94 102 [ticket-custom] 95 103 mostlyhidden.show_when_type = enhancement … … 103 111 In the version/milestone example above, if the {{{milestone}}} changes then we want the {{{version}}} field to be cleared: 104 112 {{{ 113 #!ini 105 114 [ticket-custom] 106 115 version.clear_on_change_of = milestone … … 113 122 Let's say your workflow includes reassigning a ticket's {{{owner}}} to someone else for review or verification but maintain the person responsible for the work in a custom {{{captain}}} field. Initially the {{{captain}}} should be set to the {{{owner}}}, so to reduce data entry in making this so: 114 123 {{{ 124 #!ini 115 125 [ticket-custom] 116 126 captain.copy_from = owner … … 119 129 The default copy behavior is to not overwrite a value if one already exists. To always copy the value, add {{{(overwrite)}}} as follows: 120 130 {{{ 131 #!ini 121 132 [ticket-custom] 122 133 captain.copy_from = owner (overwrite) … … 127 138 Let's say your QA team usually creates defect tickets and your product managers usually create enhancement tickets. Here's how to allow each user to set the default value for the ticket {{{type}}}: 128 139 {{{ 140 #!ini 129 141 [ticket-custom] 130 142 type.default_value = (pref) … … 133 145 For text fields, if the field's value is not empty, the default value will not be applied unless you set an {{{append}}} option to ''true'': 134 146 {{{ 147 #!ini 135 148 [ticket-custom] 136 149 cc.default_value = (pref) … … 146 159 Some fields may be required (i.e., can't be empty) or must not contain some specific values. For example: 147 160 {{{ 161 #!ini 148 162 [ticket-custom] 149 163 owner.invalid_if = … … 155 169 You can also specify a condition under which the validation should be applied: 156 170 {{{ 171 #!ini 157 172 [ticket-custom] 158 173 phase.invalid_if.1 = verifying … … 167 182 When a developer starts working on a ticket, you may want to make sure she sets the milestone accordingly: 168 183 {{{ 184 #!ini 169 185 [ticket-custom] 170 186 milestone.set_to_milestone3_when_phase = implementation|verifying|releasing … … 173 189 When the {{{phase}}} field changes to either ''implementation'', ''verifying'', or ''releasing'', then the {{{milestone}}} will get set to ''milestone3''. To avoid needing to update the current milestone's value in the rule, you can alternatively use the special ''"!"'' value which specifies to set the field to the first non-empty value: 174 190 {{{ 191 #!ini 175 192 milestone.set_to_!_when_phase = implementation|verifying|releasing 176 193 }}} … … 178 195 If you want to enable each user to set the value as a preference, you set to a question mark {{{?}}} as follows: 179 196 {{{ 197 #!ini 180 198 milestone.set_to_?_when_phase = implementation|verifying|releasing (pref) 181 199 }}} … … 183 201 Learn more about user preferences below. The default set behavior is to not overwrite a value if one already exists. To always set the value, add {{{(overwrite)}}} as follows: 184 202 {{{ 203 #!ini 185 204 [ticket-custom] 186 205 milestone.set_to_!_when_phase = implementation|verifying|releasing (overwrite) (pref) … … 193 212 Any rule expressed above can be configured to allow users to set preferences for them by appending ''(pref)'' to the end of the rule. For example, here's one of the hide rules from above: 194 213 {{{ 214 #!ini 195 215 [ticket-custom] 196 216 alwayshidden.show_when_type = invalid_value (pref) … … 199 219 The ''(pref)'' will cause this rule to be added to a new '''Dynamic Fields''' preference panel where the user can disable the rule by unchecking the rule's checkbox. Some rules require user input such as the default value rule above. In that example, the user can both enable/disable the rule as well as set the field's default value for him/her. If you wish to disable a rule as the default preference, append ''(pref:disable)'' to the end of the rule like so: 200 220 {{{ 221 #!ini 201 222 [ticket-custom] 202 223 alwayshidden.show_when_type = invalid_value (pref:disable) … … 229 250 Preparing the plugin from source now requires the additional step of compiling message catalog files. As long as you stick to the message catalogs served with this plugin directly, there is still nothing special to be done. Just package your plugin from source the standard way: 230 251 {{{ 252 #!ini 231 253 cd dynamicfieldsplugin 232 254 python ./setup.py bdist_egg … … 236 258 Only if you encounter message catalogs with translations marked 'fuzzy', including them would require special treatment, since automatic compilation trashes them by default. Walk through: 237 259 {{{ 260 #!sh 238 261 cd dynamicfieldsplugin 239 262 python ./setup.py compile_catalog -f