Changes between Version 2 and Version 3 of TracWorkflow


Ignore:
Timestamp:
2019-05-02T09:45:05-03:00 (6 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracWorkflow

    v2 v3  
    77== The Default Ticket Workflow
    88
    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
     11When you run `trac-admin <env> upgrade`, your `trac.ini` will be modified to include a `[ticket-workflow]` section.
     12The 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
     15leave = * -> *
     16leave.operations = leave_status
     17leave.default = 1
     18accept = new -> assigned
     19accept.permissions = TICKET_MODIFY
     20accept.operations = set_owner_to_self
     21resolve = new,assigned,reopened -> closed
     22resolve.permissions = TICKET_MODIFY
     23resolve.operations = set_resolution
     24reassign = new,assigned,reopened -> new
     25reassign.permissions = TICKET_MODIFY
     26reassign.operations = set_owner
     27reopen = closed -> reopened
     28reopen.permissions = TICKET_CREATE
     29reopen.operations = del_resolution
     30}}}
     31
     32There 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
     36When 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:
    1037
    1138{{{#!Workflow width=700 height=300
     
    1340leave.operations = leave_status
    1441leave.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 
    2442accept = new,assigned,accepted,reopened -> accepted
    2543accept.permissions = TICKET_MODIFY
    2644accept.operations = set_owner_to_self
    27 
    2845resolve = new,assigned,accepted,reopened -> closed
    2946resolve.permissions = TICKET_MODIFY
    3047resolve.operations = set_resolution
    31 
    3248reassign = new,assigned,accepted,reopened -> assigned
    3349reassign.permissions = TICKET_MODIFY
    3450reassign.operations = set_owner
    35 
    3651reopen = closed -> reopened
    3752reopen.permissions = TICKET_CREATE
     
    6681- **del_owner** -- Clear the owner field.
    6782- **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.
    6984- **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)//.
    7185- **del_resolution** -- Clears the resolution field.
    7286- **set_resolution** -- Sets the resolution to the selected value.
     
    7488 {{{#!ini
    7589resolve_new = new -> closed
    76 resolve_new.label = resolve
     90resolve_new.name = resolve
    7791resolve_new.operations = set_resolution
    7892resolve_new.permissions = TICKET_MODIFY
     
    8397'''Note:''' Specifying conflicting operations, such as `set_owner` and `del_owner`, has unspecified results.
    8498
    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`:
     99In this example, we see the `.name` attribute used. The action here is `resolve_accepted`, but it will be presented to the user as `resolve`:
    86100
    87101{{{#!ini
    88102resolve_accepted = accepted -> closed
    89 resolve_accepted.label = resolve
     103resolve_accepted.name = resolve
    90104resolve_accepted.permissions = TICKET_MODIFY
    91105resolve_accepted.operations = set_resolution
    92106}}}
    93107
    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 
    96108For actions that should be available in all states, `*` may be used in place of the state. The obvious example is the `leave` action:
    97109{{{#!ini
     
    104116If not specified for an action, `.default` is 0. The value may be negative.
    105117
    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.
     118There 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.
    119119
    120120The 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:
     
    122122{{{#!ini
    123123_reset = -> new
    124 _reset.label = reset
     124_reset.name = reset
    125125_reset.operations = reset_workflow
    126126_reset.permissions = TICKET_ADMIN
     
    132132{{{#!ini
    133133_reset = -> new
    134 _reset.label = reset
     134_reset.name = reset
    135135_reset.operations = reset_workflow
    136136_reset.permissions = TICKET_MODIFY
     
    158158{{{#!ini
    159159testing = new,accepted,needs_work,assigned,reopened -> testing
    160 testing.label = Submit to reporter for testing
     160testing.name = Submit to reporter for testing
    161161testing.permissions = TICKET_MODIFY
    162162
    163163reject = testing -> needs_work
    164 reject.label = Failed testing, return to developer
     164reject.name = Failed testing, return to developer
    165165
    166166pass = testing -> closed
    167 pass.label = Passes Testing
     167pass.name = Passes Testing
    168168pass.operations = set_resolution
    169169pass.set_resolution = fixed
     
    204204{{{#!ini
    205205reassign_reviewing = reviewing -> *
    206 reassign_reviewing.label = reassign review
     206reassign_reviewing.name = reassign review
    207207reassign_reviewing.operations = set_owner
    208208reassign_reviewing.permissions = TICKET_MODIFY
     
    213213{{{#!ini
    214214[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
    221215accept = new,reviewing -> assigned
    222216accept.operations = set_owner_to_self
     
    239233reassign_reviewing = reviewing -> *
    240234reassign_reviewing.operations = set_owner
    241 reassign_reviewing.label = reassign review
     235reassign_reviewing.name = reassign review
    242236reassign_reviewing.permissions = TICKET_MODIFY
    243237}}}
     
    249243{{{#!ini
    250244resolve_new = new -> closed
    251 resolve_new.label = resolve
     245resolve_new.name = resolve
    252246resolve_new.operations = set_resolution
    253247resolve_new.permissions = TICKET_MODIFY
     
    271265== Ideas for next steps
    272266
    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.
     267New 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
     269Some of the ideas described here are originally proposed in [trac:NewWorkflow].