= Workflow based on ticket type [[PageOutline(2-5,Contents,pullout)]] == Description The MultipleWorkflowPlugin replaces the !ConfigurableTicketPlugin used by trac to control what actions a ticket can do reading `[ticket-workflow]` session. With MultipleWorkflowPlugin trac can read the workflow based on the type of ticket that is considering. If a section for that ticket type doesn't exist than it uses the default workflow. == Bugs/Feature Requests Existing bugs and feature requests for MultipleWorkflowPlugin are [report:9?COMPONENT=MultipleWorkflowPlugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=MultipleWorkflowPlugin&owner=Cinc-th new ticket]. [[TicketQuery(component=MultipleWorkflowPlugin&group=type,format=progress)]] == Download Download the zipped source from [download:multipleworkflowplugin here]. == Source You can check out MultipleWorkflowPlugin from [http://trac-hacks.org/svn/multipleworkflowplugin here] using Subversion, or [source:multipleworkflowplugin browse the source] with Trac. == Installation Enable the plugin with: {{{#!ini [components] multipleworkflow.* = enabled }}} Add the controller to the workflow controller list: {{{#!ini workflow = MultipleWorkflowPlugin }}} == Example == For using it you should have the {{{[ticket-workflow]}}} section in your ''trac.ini'' file because when a custom section for a ticket type doesn't exist that one is used. To define a different workflow for a ticket with type {{{Requirement}}} create a section in ''trac.ini'' called {{{[ticket-workflow-Requirement]}}} and add your workflow items: {{{#!ini [ticket-workflow-Requirement] leave = * -> * leave.default = 1 leave.operations = leave_status approve = new, reopened -> approved approve.operations = del_resolution approve.permissions = TICKET_MODIFY reopen_verified = closed -> reopened reopen_verified.name= Reopen reopen_verified.operations = set_resolution reopen_verified.set_resolution=from verified reopen_verified.permissions = TICKET_MODIFY reopen_approved = approved -> reopened reopen_approved.name = Reopen reopen_approved.operations = set_resolution reopen_approved.set_resolution=from approved reopen_approved.permissions = TICKET_CREATE remove = new, reopened, approved, closed -> removed remove.name=Remove this Requirement permanently remove.operations = set_resolution remove.set_resolution= removed remove.permissions = TICKET_MODIFY verify = approved -> closed verify.name=Verifiy the Requirement and mark verify.operations = set_resolution verify.set_resolution=verified verify.permissions = TICKET_MODIFY }}} This results in the following workflow: {{{ #!Workflow width=900 height=400 leave = * -> * leave.default = 1 leave.operations = leave_status approve = new, reopened -> approved approve.operations = del_resolution approve.permissions = TICKET_MODIFY reopen_verified = closed -> reopened reopen_verified.name= Reopen reopen_verified.operations = set_resolution reopen_verified.set_resolution=from verified reopen_verified.permissions = TICKET_MODIFY reopen_approved = approved -> reopened reopen_approved.name = Reopen reopen_approved.operations = set_resolution reopen_approved.set_resolution=from approved reopen_approved.permissions = TICKET_CREATE remove = new, reopened, approved, closed -> removed remove.name=Remove this Requirement permanently remove.operations = set_resolution remove.set_resolution= removed remove.permissions = TICKET_MODIFY verify = approved -> closed verify.name=Verifiy the Requirement and mark verify.operations = set_resolution verify.set_resolution=verified verify.permissions = TICKET_MODIFY }}} == Add Custom Statuses to Query Page == Your custom statuses are normally not available on the Trac query page for filtering tickets. Trac core only looks at the default workflow when gathering the statuses (for obvious reasons since it doesn't know about your private workflow). To have your custom status appear which is defined in {{{[ticket-workflow-my_type]}}} add it to the default section {{{[ticket-workflow]}}} like this: {{{#!ini [ticket-workflow] [...] # The following are from other workflows. By including them here they will show up # as a selectable item on the ticket query page. approve = approved -> approved remove = removed -> removed [...] }}} Because there is no transition to the statuses {{{approved}}} and {{{removed}}} in the default workflow these items will never show up as a selectable item on the ticket page of standard tickets, yet you see them on the query page. == Recent Changes [[ChangeLog(multipleworkflowplugin, 3)]] == Author/Contributors '''Author:''' [wiki:ermal] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''