Opened 8 years ago

Closed 4 years ago

#6540 closed enhancement (wontfix)

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

Reported by: Adam Bellaire Owned by: Vladimir Abramov
Priority: low Component: TypedTicketWorkflowPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


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:


    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 8 years ago by Ryan J Ollos

Summary: Configuration for tickets "not" of given types[Patch] Configuration for tickets "not" of given types
Type: defectenhancement

comment:2 Changed 4 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Vladimir Abramov.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.