> Hi, > > Is it possible to set some ticket fields as required? I'm trying to ensure > tickets cannot be created without being set to a milestone. > > Mark
For this, you can use the ValidatorPlugin - in the recent state, this requires fields in depency on the state. However, I recently improved this plugin and plan to post it very soon, hopefully still this week. May this is what you want. I will show my short documentation below. Reinhard ============================================================ What is TicketValidatorPlugin for? ---------------------------------- This plugin checks whether selected fields are not empty resp. have a given type (integer/float) dependent on state and/or type of the ticket. Dependence/independence on status and/or type are extensions requested in tickets #4742 and #6067. Checks on integer resp. float are my own extensions since they were easy to implement. Configuration ------------- Configure trac.ini, e.g.: [components] ... ticketvalidator.* = enabled [ticketvalidator] new.required = purpose *.required = address done.*.required = weather, brightness *.integer = age, lines_of_code *.task.float = cost This means: - If the state is 'new', the field 'purpose' must be filled-in. - 'address' is always required. - If the state is 'done', 'weather' and 'brightness' are required, independent on the type (of course, "done.required = ..." would do the same here). - 'age' and 'lines_of_code' must always be integers. - Independent on the state, 'cost' must be a float if the ticket type is 'task'. Improvements since 0.1 ---------------------- - Arbitrary states resp. types can be noted by "*". - Optional depency on ticket type was added. - Error messages are nicer now - in particular, the field labels are shown instead of field names. - no error messages if non-existing fields are configured in trac.ini (return 'False' e.g. in _is_empty() Extensions ---------- It is no problem to add more checks and more ticket parameters - the tuples 'actionlst' and 'parms' have to be extended in core.py to this end, and new test functions have to be defined. TODO ---- The admin panel has not been adapted yet. -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
