Edgewall Software

Opened 8 years ago

Last modified 2 years ago

#11856 new enhancement

Default values of ticket workflow fields should be configured in the [ticket-workflow] section

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: next-dev-1.7.x
Component: ticket system Version:
Severity: normal Keywords: workflow
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

The fields resolution and status in the list of Ticket.protected_fields (tags/trac-1.0.2/trac/ticket/model.py@:51-52#L49) are only modified by the workflow. #2045 moves Trac one step closer to adding owner to Ticket.protected_fields and only allowing the workflow to change the owner field (see comment:60:ticket:2045).

Having default_resolution and default_owner as attributes of a ticket workflow action and configured through the [ticket-workflow] section rather than the [ticket] section has a few advantages:

  • It should be clear that these fields are controlled by the ticket workflow.
  • Unique default values can be provided for each action in the workflow.

I've also found the attribute names set_owner and set_resolution to be a bit confusing. We might consider renaming these to resolutions / owners or allowed_resolutions / allowed_owners.

For completeness, we could also consider adding restrict_owner as a workflow attribute, replacing or overriding [ticket] restrict_owner. This was mentioned in comment:1:ticket:11976.

Attachments (0)

Change History (14)

comment:1 by Ryan J Ollos, 8 years ago

TODO After this ticket is implemented we can redefine the documented constraints on the ticket workflow (wiki:1.1/TracWorkflow#BasicTicketWorkflowCustomization):

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.

in reply to:  1 comment:2 by Ryan J Ollos, 8 years ago

Replying to rjollos:

On second thought I think the constraint of having a ticket in the new state doesn't depend on this ticket, though #11858 is somewhat important to completely eliminating that constraint. However, after this ticket is implemented we can discuss in the documentation how the population of the owner field can be driven by the workflow.

Documentation updated in 1.1/TracWorkflow@7.

Last edited 6 years ago by Ryan J Ollos (previous) (diff)

comment:3 by Ryan J Ollos, 8 years ago

To support all possible use cases related to #7979, we might want to have a special <user> value that refers to the currently logged-in user. That would support two cases not handled by set_owner_to_self:

  • Specifying a restricted set of users via the set_owner attribute and including the currently logged-in user in that set.
  • Specifying the currently logged-in user as the default_owner.

comment:4 by Ryan J Ollos, 8 years ago

Milestone: next-dev-1.1.x1.1.4

comment:5 by Ryan J Ollos, 8 years ago

#10913 closed as a duplicate, requesting the ability to set a default value for the set_owner workflow operation.

Last edited 8 years ago by Ryan J Ollos (previous) (diff)

comment:6 by Ryan J Ollos, 8 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:7 by Ryan J Ollos, 8 years ago


Narrowing focus for 1.1.4.

comment:8 by Ryan J Ollos, 8 years ago


comment:9 by Ryan J Ollos, 8 years ago


Milestone renamed

comment:10 by Ryan J Ollos, 8 years ago

Milestone: 1.1.6next-dev-1.1.x
Owner: Ryan J Ollos removed
Status: assignednew

comment:11 by Ryan J Ollos, 8 years ago

Description: modified (diff)

comment:12 by Ryan J Ollos, 7 years ago

Milestone: next-dev-1.1.xnext-dev-1.3.x

Narrowing focus for milestone:1.2. Please move ticket to milestone:1.2 if you intend to fix it.

comment:13 by Ryan J Ollos, 3 years ago

Milestone: next-dev-1.3.xnext-dev-1.5.x

Milestone renamed

comment:14 by Ryan J Ollos, 2 years ago

Milestone: next-dev-1.5.xnext-dev-1.7.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.