id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges 5866,"[patch] Workflow tweak: handle ""not-state"" transition specifications",Morris,,"I found myself wanting things like this in my `[ticket-workflow]`: {{{#!ini 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: {{{#!ini needinfo = *,!needinfo -> needinfo needinfo.name = need info needinfo.operations = set_owner needinfo.permissions = TICKET_MODIFY }}} This would indicate that the ""needinfo"" state was a valid next state from every other state ''except'' ""needinfo"". To make this work, make the following tweak to `/trac/ticket/default_workflow.py` (line 161): {{{#!python if oldstates == ['*'] or status in oldstates: }}} ...becomes... {{{#!python if ('*' in oldstates or status in oldstates) and (""!%s""%status not in oldstates): }}} I haven't tested this extensively, and even though it should be backwards-compatible... use with extra initial scrutiny.",enhancement,new,low,unscheduled,ticket system,devel,normal,,patch workflow state,gt4329b@… jevans kace25_2000@…,,,,