Edgewall Software
Modify

Opened 12 years ago

Last modified 2 years ago

#10755 new enhancement

[PATCH] CommitTicketUpdater does not allow user to define what state to jump to

Reported by: patrick.little Owned by:
Priority: normal Milestone: next-major-releases
Component: ticket system Version: 0.12.3
Severity: normal Keywords: CommitTicketUpdater patch
Cc: ethan.jucovy@…, sterkrig@…, skrattaren@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The CommitTicketUpdater will only ever close a ticket. In general, the closed state is for when no more work is to be done, aka after QA has verified the fix. Trac should allow configuration of what state name the ticket will get updated to.

Attachments (1)

trac.patch (1.3 KB ) - added by Andreas Helmcke <ahelmcke@…> 2 years ago.
Patch for options for closed state and resolution.

Download all attachments as: .zip

Change History (24)

comment:1 by anonymous, 12 years ago

Yes, this would be a nice feature. I've wanted to be able to define reopens as a keyword that changes the state of the ticket to reopened, as well as transition tickets that are fixed from acceptedimplemented, rather than from accepted to closed.

comment:2 by Ryan J Ollos <ryano@…>, 12 years ago

Cc: ryano@… added

comment:3 by clemens@…, 11 years ago

This would be cool!

In addition, it would be great if the CommitTicketUpdater would use the default_resolution configured in the [ticket] section of trac.ini if no other state has been specified. Currently, it sets the state to fixed (hard-coded in commit_updater.py, line 251), although my custom workflow has no fixed state.

comment:4 by ethan.jucovy@…, 11 years ago

Cc: ethan.jucovy@… added

comment:5 by Paul Wise <pabs3@…>, 11 years ago

For those who are looking for a workaround for this lack of feature, I added a simple plugin to do what I wanted:

from tracopt.ticket.commit_updater import CommitTicketUpdater

class CustomCommitTicketUpdater(CommitTicketUpdater):

	def cmd_close(self, ticket, changeset, perm):
		if not self.check_perms or 'TICKET_MODIFY' in perm:
			ticket['status'] = 'reviewing'
			ticket['owner'] = ticket['reporter']

in reply to:  5 comment:6 by patrick.little@…, 11 years ago

Replying to Paul Wise <pabs3@…>:

For those who are looking for a workaround for this lack of feature, I added a simple plugin to do what I wanted:

from tracopt.ticket.commit_updater import CommitTicketUpdater

class CustomCommitTicketUpdater(CommitTicketUpdater):

	def cmd_close(self, ticket, changeset, perm):
		if not self.check_perms or 'TICKET_MODIFY' in perm:
			ticket['status'] = 'reviewing'
			ticket['owner'] = ticket['reporter']

I've tried following the various tutorials and I just can't get the plugin to show up in my admin panel. I can follow the t-h.o egg cooking tutorial and get the helloworld example to show up, but when I switch over to this code nothing shows up.

comment:7 by Christian Boos, 11 years ago

Milestone: unscheduled

A few configuration options for the commit ticket updater could indeed help.

PatchWelcome.

in reply to:  5 comment:8 by brad@…, 11 years ago

I find that the simple plugin approach works but there's something odd going on as the ticket goes to 'closed' first and then the custom updater moves it to 'reviewing' (or 'test' or whatever), resulting in two entries in the ticket's history. It's like the base implementation is being called and the simple plugin is not overriding that behaviour. Am I missing something simple here?

comment:9 by Remy Blank, 11 years ago

If your plugin subclasses CommitTicketUpdater, you need to disable the base component (tracopt.ticket.commit_updater.CommitTicketUpdater) in trac.ini.

in reply to:  9 comment:10 by anonymous, 11 years ago

Replying to rblank:

If your plugin subclasses CommitTicketUpdater, you need to disable the base component (tracopt.ticket.commit_updater.CommitTicketUpdater) in trac.ini.

That works perfectly. Many thanks.

comment:11 by Ryan J Ollos, 11 years ago

Cc: ryano@… removed

comment:12 by sterkrig@…, 10 years ago

Cc: sterkrig@… added

comment:13 by Ryan J Ollos, 10 years ago

Keywords: CommitTicketUpdater added

comment:14 by skrattaren, 10 years ago

Cc: skrattaren@… added

comment:15 by patrick.little@…, 10 years ago

Please clear the reported by field - I no longer am using Trac and do not want to keep getting ticket updates when something changes.

comment:16 by Ryan J Ollos, 10 years ago

Reporter: changed from patrick.little@… to patrick.little

comment:17 by Ryan J Ollos, 10 years ago

Milestone: unschedulednext-major-releases
Priority: highestnormal
Severity: majornormal

comment:18 by Ryan J Ollos, 9 years ago

#11947 closed as a duplicate.

comment:19 by Ryan J Ollos, 7 years ago

TODO Add documentation when implemented, see TracWorkflow@72.

See also 0.11/TracWorkflow.

comment:20 by Ryan J Ollos, 7 years ago

#11093 and #12908 closed as duplicates.

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

comment:21 by Michael Kriegel, 6 years ago

I am also very interested in this feature!

by Andreas Helmcke <ahelmcke@…>, 2 years ago

Attachment: trac.patch added

Patch for options for closed state and resolution.

comment:22 by Andreas Helmcke <ahelmcke@…>, 2 years ago

Added a patch which addresses this problem. Patch is against current trunk (Rev. 17579)

The Patch introduces two new options: for [ticket]

option description default
commit_ticket_update_close_stateState to change to if a close command is detected.closed
commit_ticket_update_close_resolutionResolution to set, if closed state is closed.fixed
Last edited 2 years ago by Ryan J Ollos (previous) (diff)

comment:23 by Andreas Helmcke <ahelmcke@…>, 2 years ago

Keywords: patch added
Summary: CommitTicketUpdater does not allow user to define what state to jump to[PATCH] CommitTicketUpdater does not allow user to define what state to jump to

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.