Changes between Version 6 and Version 7 of TracWorkflow
- Timestamp:
- Dec 21, 2016, 10:38:27 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracWorkflow
v6 v7 7 7 == The Default Ticket Workflow 8 8 9 === Environments upgraded from 0.10 10 11 When you run `trac-admin <env> upgrade`, your `trac.ini` will be modified to include a `[ticket-workflow]` section. 12 The workflow configured in this case is the original workflow, so that ticket actions will behave like they did in 0.10: 13 14 {{{#!Workflow width=500 height=240 15 leave = * -> * 16 leave.operations = leave_status 17 leave.default = 1 18 accept = new -> assigned 19 accept.permissions = TICKET_MODIFY 20 accept.operations = set_owner_to_self 21 resolve = new,assigned,reopened -> closed 22 resolve.permissions = TICKET_MODIFY 23 resolve.operations = set_resolution 24 reassign = new,assigned,reopened -> new 25 reassign.permissions = TICKET_MODIFY 26 reassign.operations = set_owner 27 reopen = closed -> reopened 28 reopen.permissions = TICKET_CREATE 29 reopen.operations = del_resolution 30 }}} 31 32 There are some significant caveats in this, such as accepting a ticket sets it to 'assigned' state, and assigning a ticket sets it to 'new' state. So you will probably want to migrate to "basic" workflow, see contrib/workflow/migrate_original_to_basic.py. 33 34 === Environments created with 0.11 35 36 When a new environment is created, a default workflow is configured in your trac.ini. This workflow is the basic workflow, such as specified in `basic-workflow.ini`, which is somewhat different from the workflow of the 0.10 releases: 9 When a new environment is created, a default workflow is configured in your trac.ini. This workflow is the basic workflow, such as specified in [trac:source:/trunk/trac/ticket/workflows/basic-workflow.ini basic-workflow.ini]: 37 10 38 11 {{{#!Workflow width=700 height=300 … … 40 13 leave.operations = leave_status 41 14 leave.default = 1 15 16 create = <none> -> new 17 create.default = 1 18 19 create_and_assign = <none> -> assigned 20 create_and_assign.label = assign 21 create_and_assign.permissions = TICKET_MODIFY 22 create_and_assign.operations = may_set_owner 23 42 24 accept = new,assigned,accepted,reopened -> accepted 43 25 accept.permissions = TICKET_MODIFY 44 26 accept.operations = set_owner_to_self 27 45 28 resolve = new,assigned,accepted,reopened -> closed 46 29 resolve.permissions = TICKET_MODIFY 47 30 resolve.operations = set_resolution 31 48 32 reassign = new,assigned,accepted,reopened -> assigned 49 33 reassign.permissions = TICKET_MODIFY 50 34 reassign.operations = set_owner 35 51 36 reopen = closed -> reopened 52 37 reopen.permissions = TICKET_CREATE … … 81 66 - **del_owner** -- Clear the owner field. 82 67 - **set_owner** -- Sets the owner to the selected or entered owner. Defaults to the current user. When `[ticket] restrict_owner = true`, the select will be populated with users that have `TICKET_MODIFY` permission and an authenticated session. 83 - ''actionname''`.set_owner` may optionally be set to a comma delimited list of users that will be used to populate the select, or a single user. 68 - ''actionname''`.set_owner` may optionally be set to a comma delimited list of users that will be used to populate the select, or a single user. Groups and permissions may also be included in the list //(Since 1.1.3)//. When groups or permissions are specified the select is populated with all members of the group or all users that possess the permission. 84 69 - **set_owner_to_self** -- Sets the owner to the logged in user. 70 - **may_set_owner** -- Sets the owner to the selected or entered owner. Defaults to the existing owner. //(Since 1.1.2)//. 85 71 - **del_resolution** -- Clears the resolution field. 86 72 - **set_resolution** -- Sets the resolution to the selected value. … … 88 74 {{{#!ini 89 75 resolve_new = new -> closed 90 resolve_new. name= resolve76 resolve_new.label = resolve 91 77 resolve_new.operations = set_resolution 92 78 resolve_new.permissions = TICKET_MODIFY … … 97 83 '''Note:''' Specifying conflicting operations, such as `set_owner` and `del_owner`, has unspecified results. 98 84 99 In this example, we see the `. name` attribute used. The action here is `resolve_accepted`, but it will be presented to the user as `resolve`:85 In this example, we see the `.label` attribute used. The action here is `resolve_accepted`, but it will be presented to the user as `resolve`: 100 86 101 87 {{{#!ini 102 88 resolve_accepted = accepted -> closed 103 resolve_accepted. name= resolve89 resolve_accepted.label = resolve 104 90 resolve_accepted.permissions = TICKET_MODIFY 105 91 resolve_accepted.operations = set_resolution 106 92 }}} 93 94 In this example, we see the `.label` attribute used. The action here is `resolve_accepted`, but it will be presented to the user as `resolve`. The `.label` attribute is new in Trac 1.1.3 and is functionally the same as the `.name` attribute, which is now deprecated. If neither `.label` or `.name` is specified, the action will be presented to the user as //resolve accepted//, the underscores having been replaced by whitespace (//Since 1.1.3//). 107 95 108 96 For actions that should be available in all states, `*` may be used in place of the state. The obvious example is the `leave` action: … … 116 104 If not specified for an action, `.default` is 0. The value may be negative. 117 105 118 There are a couple of hard-coded constraints to the workflow. In particular, tickets are created with status `new`, and tickets are expected to have a `closed` state. Further, the default reports/queries treat any state other than `closed` as an open state. 106 The ticket create actions are specified by a transition from the special `<none>` state. At least one create action must be available to the user in order for tickets to be created. The create actions defined in the default workflow are: 107 {{{#!ini 108 create = <none> -> new 109 create.default = 1 110 111 create_and_assign = <none> -> assigned 112 create_and_assign.label = assign 113 create_and_assign.permissions = TICKET_MODIFY 114 create_and_assign.operations = may_set_owner 115 }}} 116 117 118 There is one hard-coded constraints to the workflow: tickets are expected to have a `closed` state. The default reports/queries treat any state other than `closed` as an open state. 119 119 120 120 The special `_reset` action is added by default for tickets that are in states that are no longer defined. This allows tickets to be individually "repaired" after the workflow is changed, although it's recommended that the administrator perform the action by batch modifying the affected tickets. By default the `_reset` action is available to users with the `TICKET_ADMIN` permission and reset tickets are put in the //new// state. The default `_reset` action is equivalent to the following `[ticket-workflow]` action definition: … … 122 122 {{{#!ini 123 123 _reset = -> new 124 _reset. name= reset124 _reset.label = reset 125 125 _reset.operations = reset_workflow 126 126 _reset.permissions = TICKET_ADMIN … … 132 132 {{{#!ini 133 133 _reset = -> new 134 _reset. name= reset134 _reset.label = reset 135 135 _reset.operations = reset_workflow 136 136 _reset.permissions = TICKET_MODIFY … … 158 158 {{{#!ini 159 159 testing = new,accepted,needs_work,assigned,reopened -> testing 160 testing. name= Submit to reporter for testing160 testing.label = Submit to reporter for testing 161 161 testing.permissions = TICKET_MODIFY 162 162 163 163 reject = testing -> needs_work 164 reject. name= Failed testing, return to developer164 reject.label = Failed testing, return to developer 165 165 166 166 pass = testing -> closed 167 pass. name= Passes Testing167 pass.label = Passes Testing 168 168 pass.operations = set_resolution 169 169 pass.set_resolution = fixed … … 204 204 {{{#!ini 205 205 reassign_reviewing = reviewing -> * 206 reassign_reviewing. name= reassign review206 reassign_reviewing.label = reassign review 207 207 reassign_reviewing.operations = set_owner 208 208 reassign_reviewing.permissions = TICKET_MODIFY … … 213 213 {{{#!ini 214 214 [ticket-workflow] 215 create = <none> -> new 216 create.default = 1 217 create_and_assign = <none> -> assigned 218 create_and_assign.label = assign 219 create_and_assign.permissions = TICKET_MODIFY 220 create_and_assign.operations = may_set_owner 215 221 accept = new,reviewing -> assigned 216 222 accept.operations = set_owner_to_self … … 233 239 reassign_reviewing = reviewing -> * 234 240 reassign_reviewing.operations = set_owner 235 reassign_reviewing. name= reassign review241 reassign_reviewing.label = reassign review 236 242 reassign_reviewing.permissions = TICKET_MODIFY 237 243 }}} … … 243 249 {{{#!ini 244 250 resolve_new = new -> closed 245 resolve_new. name= resolve251 resolve_new.label = resolve 246 252 resolve_new.operations = set_resolution 247 253 resolve_new.permissions = TICKET_MODIFY … … 265 271 == Ideas for next steps 266 272 267 New enhancement ideas for the workflow system should be filed as enhancement tickets against the `ticket system` component. You can also document ideas on the [trac:TracIdeas/TracWorkflow TracIdeas/TracWorkflow] page. Also look at the [http://trac-hacks.org/wiki/AdvancedTicketWorkflowPlugin AdvancedTicketWorkflowPlugin] as it provides experimental operations. 268 269 Some of the ideas described here are originally proposed in [trac:NewWorkflow]. 273 Enhancement ideas for the workflow system should be filed as enhancement tickets against the [trac:query:?status=assigned&status=new&status=reopened&keywords=~workflow&component=ticket+system ticket system] component. You can also document ideas on the [trac:TracIdeas/TracWorkflow TracIdeas/TracWorkflow] page. Also look at the [http://trac-hacks.org/wiki/AdvancedTicketWorkflowPlugin AdvancedTicketWorkflowPlugin] as it provides experimental operations.