143 | | The above will prevent the ticket from being submitted if either the owner field is empty or the severity field's value equals "pick one". The value for the {{{invalid_if}}} rule can be empty or any regular expression. Hidden fields do not get validated. |
| 144 | The above will prevent the ticket from being submitted if either the {{{owner}}} field is empty or the {{{severity}}} field's value equals ''pick one''. The value for the {{{invalid_if}}} rule can be empty or any regular expression. Hidden fields do not get validated. |
| 145 | |
| 146 | |
| 147 | ==== Set rule ==== |
| 148 | When a developer starts working on a ticket, you may want to make sure she sets the milestone accordingly: |
| 149 | {{{ |
| 150 | [ticket-custom] |
| 151 | milestone.set_when_phase = implementation|verifying|releasing |
| 152 | milestone.set_to = milestone3 |
| 153 | milestone.overwrite = false |
| 154 | }}} |
| 155 | |
| 156 | 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, you can alternatively use the special ''"!"'' value which specifies to set the field to the first non-empty value: |
| 157 | {{{ |
| 158 | milestone.set_to = ! |
| 159 | }}} |
| 160 | |
| 161 | If you want to enable each user to set the value as a preference, you should omit the {{{set_to}}} option entirely and instead specify the rule as follows: |
| 162 | {{{ |
| 163 | milestone.set_when_phase = implementation|verifying|releasing (pref) |
| 164 | milestone.overwrite = false |
| 165 | }}} |
| 166 | |
| 167 | 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, set the {{{overwrite}}} option to ''true''. |