Opened 11 years ago
Closed 11 years ago
#11423 closed enhancement (duplicate)
Make timeline ticket updates aware of workflow actions
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Ticket updates on the timeline are not currently workflow-aware. Instead of using workflow actions to distinguish between created, reopened, closed, and updated tickets, the timeline looks for status changes in the ticket_change table, and hard-codes certain verbs based on the ticket's status change.
These verbs overlap somewhat with the actions provided by the default workflow but in fact are completely independent of them: for example, if a ticket's status changes to "reopened", the timeline will render an event saying "Ticket .. reopened by .." regardless of what workflow action (if any) caused the ticket to arrive in the "reopened" state.
This overlap in responsibilities is confusing, and also means that certain assumptions about the ticket workflow are hardcoded into the timeline:
- The timeline assumes that a "reopened" state exists, and has some special meaning which should be distinguished from other ticket updates in the timeline
- The timeline does not know how to distinguish between any other types of ticket updates, even though some of these might be more special than others
It would be nice if the ticket updates in the timeline could be made workflow-aware, and if they could use historical workflow actions to render themselves instead of using status changes.
Attachments (1)
Change History (3)
by , 11 years ago
Attachment: | workflow-aware-timeline.diff added |
---|
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Whoops — this is a duplicate of #5441, sorry.
attachment:workflow-aware-timeline.diff implements a (not quite complete) proof of concept using the following approach:
trac.ticket.model.Ticket.save_changes
has a new optional keyword argumentaction
, which is aITicketActionController
-style string like "accept", "reopen", "close", etc.action
is provided toTicket.save_changes
, the action string will be saved alongside the ticket changes.ticket_change
table, in a manner similar to "comment" storage: a row is created with type="action", oldvalue=cnum, and newvalue set to the action string.ITicketActionController
interface has a new method,get_action_timeline_label(req, ticket_resource, action)
. An action controller may return a past-tense label for the givenaction
, e.g. "accept" ⇒ "accepted", "reopen" ⇒ "reopened".ConfigurableTicketWorkflow
implements this interface by looking for configuration like[ticket-workflow] accept.past_tense = accepted
.TicketSystem
has a similar new methodget_action_timeline_label
which asks each of itsaction_controllers
for a response in turn. The first action controller to respond gets to set the label. If no action controller responds, theTicketSystem
defaults to adding the suffic "ed" to the end of the action string.ticket_change
rows with type="action", similar to its special-case handling of type="comment" rows. Rows with type="action" are not rendered as individual ticket change entries. Instead, if an action row is found for a group of changes, its newvalue is used as the event's verb, instead of relying on the verbs in the hard-codedstatus_map
.If this approach seems good, next steps would include:
I know that storing action strings in the ticket_change table (and extending the
ITicketActionController
interface) is a pretty far-reaching change for an arguably minor timeline enhancement, but I think it makes the codebase more consistently workflow-friendly, and other parts of the system (including plugins) could potentially do interesting things with a persistent history of workflow actions.