Hello Scott,

Scott Bussinger wrote:
> Is there any standard facility in Trac for custom field validations
> before saving tickets? Let's say for instance that I wanted to ensure
> that the Milestone field was blank if the ticket status is "closed"
> and the resolution is not "fixed"? Or requiring that a custom field be
> not blank if the status is not "new"? Or any other such combination of
> field values.
>
> I don't see anything in the base product and nothing in trac-hacks.org
> seems to cover this. Is it possible to write a special plugin that
> would prevent saving forms based on some custom logic?
>
> Assuming that a custom plugin could handle this, does anyone have a
> sample plugin that does something like this? Is there someplace in
> particular I could go to find someone I could pay to put together
> something like this? The validations I have in mind are nothing much
> more complicated than the examples I mentioned above.
>   

You can write a component implementing the ITicketManipulator interface 
(see in trac/ticket/api.py).

If you're talking about 0.11dev, you should have a look to 
http://trac.edgewall.org/ticket/6879 and see how the above interacts now 
with the workflow and the ITicketActionController interface. You could 
verify if your use case would work well with the proposed solution to 
the issue (change_but_rollback_on_preview_or_failure.2.patch).

-- Christian

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to