I found myself wanting things like this in my [ticket-workflow]:

reassign = * -> *
reassign.operations = set_owner,leave_status
reassign.permissions = TICKET_MODIFY

needinfo = * -> needinfo
needinfo.name = need info
needinfo.operations = set_owner
needinfo.permissions = TICKET_MODIFY

...but this would create two action options for a ticket in the
"needinfo" state: "reassign and leave as needinfo", and "assign to new
owner and leave as needinfo" ...which are of course the same thing.  I
wanted to be able to do this instead:

needinfo = *,!needinfo -> needinfo
needinfo.name = need info
needinfo.operations = set_owner
needinfo.permissions = TICKET_MODIFY

To make this work, make the following tweak to /trac/ticket/
default_workflow.py:
161            if oldstates == ['*'] or status in oldstates:
...becomes...
161            if ('*' in oldstates or status in oldstates) and ("!
%s"%status not in oldstates):

I haven't tested this extensively so... use with extra initial
scrutiny.  I've got several other workflow hacks that I'm hoping to
make into actual patches in the near future, including this one -- but
this one was too easy (and useful) to wait.


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