Changes between Version 2 and Version 3 of TracWorkflow
- Timestamp:
- Apr 1, 2017, 10:40:26 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracWorkflow
v2 v3 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 There is one hard-coded constraint 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. 107 108 === Ticket Create Action 109 110 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: 111 {{{#!ini 112 create = <none> -> new 113 create.default = 1 114 115 create_and_assign = <none> -> assigned 116 create_and_assign.label = assign 117 create_and_assign.permissions = TICKET_MODIFY 118 create_and_assign.operations = may_set_owner 119 }}} 120 121 === Ticket Reset Action 119 122 120 123 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 125 {{{#!ini 123 126 _reset = -> new 124 _reset. name= reset127 _reset.label = reset 125 128 _reset.operations = reset_workflow 126 129 _reset.permissions = TICKET_ADMIN … … 132 135 {{{#!ini 133 136 _reset = -> new 134 _reset. name= reset137 _reset.label = reset 135 138 _reset.operations = reset_workflow 136 139 _reset.permissions = TICKET_MODIFY … … 158 161 {{{#!ini 159 162 testing = new,accepted,needs_work,assigned,reopened -> testing 160 testing. name= Submit to reporter for testing163 testing.label = Submit to reporter for testing 161 164 testing.permissions = TICKET_MODIFY 162 165 163 166 reject = testing -> needs_work 164 reject. name= Failed testing, return to developer167 reject.label = Failed testing, return to developer 165 168 166 169 pass = testing -> closed 167 pass. name= Passes Testing170 pass.label = Passes Testing 168 171 pass.operations = set_resolution 169 172 pass.set_resolution = fixed … … 204 207 {{{#!ini 205 208 reassign_reviewing = reviewing -> * 206 reassign_reviewing. name= reassign review209 reassign_reviewing.label = reassign review 207 210 reassign_reviewing.operations = set_owner 208 211 reassign_reviewing.permissions = TICKET_MODIFY … … 213 216 {{{#!ini 214 217 [ticket-workflow] 218 create = <none> -> new 219 create.default = 1 220 create_and_assign = <none> -> assigned 221 create_and_assign.label = assign 222 create_and_assign.permissions = TICKET_MODIFY 223 create_and_assign.operations = may_set_owner 215 224 accept = new,reviewing -> assigned 216 225 accept.operations = set_owner_to_self … … 233 242 reassign_reviewing = reviewing -> * 234 243 reassign_reviewing.operations = set_owner 235 reassign_reviewing. name= reassign review244 reassign_reviewing.label = reassign review 236 245 reassign_reviewing.permissions = TICKET_MODIFY 237 246 }}} … … 243 252 {{{#!ini 244 253 resolve_new = new -> closed 245 resolve_new. name= resolve254 resolve_new.label = resolve 246 255 resolve_new.operations = set_resolution 247 256 resolve_new.permissions = TICKET_MODIFY … … 265 274 == Ideas for next steps 266 275 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]. 276 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.