Modify

Opened 5 years ago

Closed 10 months ago

#6540 closed enhancement (wontfix)

[Patch] Configuration for tickets "not" of given types

Reported by: bellaire@… Owned by: kivsiak
Priority: low Component: TypedTicketWorkflowPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

This plugin works great, but the fact that your configuration is opt-in can make certain configurations a hassle. Luckily, it was pretty trivial to patch the code to allow for an additional configuration for nottickettype, which is the opposite of tickettype configuration option.

For example, if you have "someaction" that isn't applicable to tasks, you can say:

someaction.nottickettype = task

Since this is an additional configuration option on top of the existing setup, enabling the patched version of the plugin for existing configurations won't break anything, and having "nottickettype" in your configuration if you don't have the patch will simply be ignored.

Here's the patch against r7501:

  • controller.py

     
    2525                    filterd_actions.append((default, action_name))
    2626            else:
    2727                filterd_actions.append((default, action_name))
    28         return filterd_actions
    29  No newline at end of file
     28           if 'nottickettype' in action_attributes:
     29               # note that if both tickettype and nottickettype are specified for the same
     30                # type, nottickettype will have precendence and the action will be unavailable
     31               forbidden_types = [a.strip() for a in
     32                                  action_attributes['nottickettype'].split(',')]
     33               if (ticket.get_value_or_default('type') in forbidden_types and
     34                   (default, action_name) in filterd_actions):
     35                       filterd_actions.remove((default, action_name))
     36        return filterd_actions

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by rjollos

  • Summary changed from Configuration for tickets "not" of given types to [Patch] Configuration for tickets "not" of given types
  • Type changed from defect to enhancement

comment:2 Changed 10 months ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

Most users will have a fairly small number of ticket types, and I think that another configuration option will just confuse things for the most part.

Add Comment

Modify Ticket

Action
as closed The owner will remain kivsiak.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.