Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 5 years ago

#1836 closed enhancement (duplicate)

Should be able to customize resolutions

Reported by: gsymons@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: ticket system Version: 0.8.4
Severity: normal Keywords: resolution
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The ability to customize the resolutions would allow Trac to be better adapted to an organization's process. For example, I'd like to have my customer enter user stories as tickets, and if they try to cram too much into a single story, I'd like to be able to have my devs close the ticket with a resolution of "SPLIT" so we can easily pull up a list of such stories. Other possibilities could include closing a ticket with a resolution of "REVIEW", and automatically (through a periodic script) reopening those tickets after a certain period if they haven't been reviewed. #905 illustrates another use of custom resolutions.

Since the resolutions themselves appear to be stored in the enum table, it would seem to be fairly simple to add this functionality to trac-admin. I could probably see if I can come up with something, but I haven't really looked at the code yet.

Attachments (0)

Change History (4)

comment:1 by gsymons@…, 19 years ago

Resolution: duplicate
Status: newclosed

Hmmm… didn't see #869 before I submitted this. Since NewWorkflow is more flexible than just custom resolutions, don't even bother on this one.

comment:2 by mkv-1724@…, 5 years ago

Currently Is it possible? "Should be able to customize resolutions?"

Thanks.

comment:3 by mkv-1724@…, 5 years ago

My solution of the problem:

import os.path
import ConfigParser #pytget_all_tickets_id()on 3 rename to configparser
from trac.core import Component, implements
from trac.env import IEnvironmentSetupParticipant, Environment
from trac.ticket.model import Resolution

CONFIG_FILE_PATH = os.path.dirname(__file__)+'/../conf/trac.ini'

class CustomResolution(Component):
    implements(IEnvironmentSetupParticipant)

    # IEnvironmentSetupParticipant methods

    def environment_created(self):
        pass

    def environment_needs_upgrade(self):
        exists_res = {r.name for r in Resolution.select(self.env)}
        config = ConfigParser.ConfigParser()
        config.read(CONFIG_FILE_PATH)
        set_res = config.get('ticket-workflow', 'resolve.set_resolution')
        curr_res = set(set_res.split(','))
        return not curr_res.issubset(exists_res)

    def upgrade_environment(self):
        config = ConfigParser.ConfigParser()
        config.read(CONFIG_FILE_PATH)
        set_res = config.get('ticket-workflow', 'resolve.set_resolution')
        curr_res = set(set_res.split(','))
        exists_res = {r.name for r in Resolution.select(self.env)}
        nonexists_res = curr_res.difference(exists_res)
        env = Environment('.', create=0)
        for n, res_name in enumerate(nonexists_res, start=1):
            resolution = Resolution(env)
            resolution.name = res_name
            resolution.value = len(exists_res)+n 
            resolution.insert()

Save and put it to path/to/trac/plugins and reload Trac.

in reply to:  3 comment:4 by Jun Omae, 5 years ago

Replying to mkv-1724@…:

My solution of the problem: […]

That plugin is not needed. Try to remove resolve.set_resolution in [ticket-workflow] section. The actionname.set_resolution is optional. If not set, defined resolutions automatically are listed.

See TracWorkflow. Also, please ask on the MailingList rather than adding comments to such old resolved tickets.

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


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