Changes between Version 2 and Version 3 of TracWorkflow
- Timestamp:
- 2019-05-02T09:45:05-03:00 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracWorkflow
v2 v3 7 7 == The Default Ticket Workflow 8 8 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]: 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: 10 37 11 38 {{{#!Workflow width=700 height=300 … … 13 40 leave.operations = leave_status 14 41 leave.default = 1 15 16 create = <none> -> new17 create.default = 118 19 create_and_assign = <none> -> assigned20 create_and_assign.label = assign21 create_and_assign.permissions = TICKET_MODIFY22 create_and_assign.operations = may_set_owner23 24 42 accept = new,assigned,accepted,reopened -> accepted 25 43 accept.permissions = TICKET_MODIFY 26 44 accept.operations = set_owner_to_self 27 28 45 resolve = new,assigned,accepted,reopened -> closed 29 46 resolve.permissions = TICKET_MODIFY 30 47 resolve.operations = set_resolution 31 32 48 reassign = new,assigned,accepted,reopened -> assigned 33 49 reassign.permissions = TICKET_MODIFY 34 50 reassign.operations = set_owner 35 36 51 reopen = closed -> reopened 37 52 reopen.permissions = TICKET_CREATE … … 66 81 - **del_owner** -- Clear the owner field. 67 82 - **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. 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.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. 69 84 - **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)//.71 85 - **del_resolution** -- Clears the resolution field. 72 86 - **set_resolution** -- Sets the resolution to the selected value. … … 74 88 {{{#!ini 75 89 resolve_new = new -> closed 76 resolve_new. label= resolve90 resolve_new.name = resolve 77 91 resolve_new.operations = set_resolution 78 92 resolve_new.permissions = TICKET_MODIFY … … 83 97 '''Note:''' Specifying conflicting operations, such as `set_owner` and `del_owner`, has unspecified results. 84 98 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`: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`: 86 100 87 101 {{{#!ini 88 102 resolve_accepted = accepted -> closed 89 resolve_accepted. label= resolve103 resolve_accepted.name = resolve 90 104 resolve_accepted.permissions = TICKET_MODIFY 91 105 resolve_accepted.operations = set_resolution 92 106 }}} 93 107 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//).95 96 108 For actions that should be available in all states, `*` may be used in place of the state. The obvious example is the `leave` action: 97 109 {{{#!ini … … 104 116 If not specified for an action, `.default` is 0. The value may be negative. 105 117 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. 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. 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. label= reset124 _reset.name = reset 125 125 _reset.operations = reset_workflow 126 126 _reset.permissions = TICKET_ADMIN … … 132 132 {{{#!ini 133 133 _reset = -> new 134 _reset. label= reset134 _reset.name = 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. label= Submit to reporter for testing160 testing.name = Submit to reporter for testing 161 161 testing.permissions = TICKET_MODIFY 162 162 163 163 reject = testing -> needs_work 164 reject. label= Failed testing, return to developer164 reject.name = Failed testing, return to developer 165 165 166 166 pass = testing -> closed 167 pass. label= Passes Testing167 pass.name = 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. label= reassign review206 reassign_reviewing.name = 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> -> new216 create.default = 1217 create_and_assign = <none> -> assigned218 create_and_assign.label = assign219 create_and_assign.permissions = TICKET_MODIFY220 create_and_assign.operations = may_set_owner221 215 accept = new,reviewing -> assigned 222 216 accept.operations = set_owner_to_self … … 239 233 reassign_reviewing = reviewing -> * 240 234 reassign_reviewing.operations = set_owner 241 reassign_reviewing. label= reassign review235 reassign_reviewing.name = reassign review 242 236 reassign_reviewing.permissions = TICKET_MODIFY 243 237 }}} … … 249 243 {{{#!ini 250 244 resolve_new = new -> closed 251 resolve_new. label= resolve245 resolve_new.name = resolve 252 246 resolve_new.operations = set_resolution 253 247 resolve_new.permissions = TICKET_MODIFY … … 271 265 == Ideas for next steps 272 266 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. 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].