#1836 closed enhancement (duplicate)
Should be able to customize resolutions
| Reported by: | 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 , 20 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
comment:2 by , 7 years ago
Currently Is it possible? "Should be able to customize resolutions?"
Thanks.
follow-up: 4 comment:3 by , 7 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.
comment:4 by , 7 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.



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.