[Patch] Configuration for tickets "not" of given types
|Reported by:||bellaire||Owned by:||kivsiak|
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:
25 25 filterd_actions.append((default, action_name)) 26 26 else: 27 27 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
Change History (2)
comment:1 Changed 6 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