Modify

Opened 14 years ago

Last modified 4 years ago

#7520 new enhancement

[Patch] Ability to have a default status on triage operations

Reported by: norberto.bezi@… Owned by:
Priority: low Component: AdvancedTicketWorkflowPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (last modified by Ryan J Ollos)

Added ability to have a default status on triage operations.

The following example will set the status to reopen by default but to bug type tickets it will set development.

Example:

reopen = closed -> *
reopen.operations = del_resolution,triage,del_owner
reopen.permissions = TICKET_CREATE
reopen.triage_field = type
reopen.triage_split = *->reopened,bug->development

SVN Diff:

Index: controller.py
===================================================================
--- controller.py       (revision 8373)
+++ controller.py       (working copy)
@@ -354,13 +354,16 @@
                                 action + '.triage_field').strip()
         transitions = self.config.get('ticket-workflow',
                                       action + '.triage_split').strip()
+        default_status = 'new'
         for transition in [x.strip() for x in transitions.split(',')]:
             value, status = [y.strip() for y in transition.split('->')]
             if value == ticket[field].strip():
                 break
+            else:
+                if value == '*':
+                    default_status = status
         else:
-            self.env.log.error("Bad configuration for 'triage' operation in action '%s'" % action)
-            status = 'new'
+            status = default_status
         return status

Attachments (0)

Change History (5)

comment:1 Changed 14 years ago by anonymous

Type: defectenhancement

comment:2 Changed 14 years ago by Ryan J Ollos

Description: modified (diff)
Summary: Ability to have a default status on triage operations[Patch] Ability to have a default status on triage operations

Updated description - Wrapped patch code in description with a code block. Btw, patches as attachments are always preferred to inline pastes.

comment:3 Changed 14 years ago by mklerk@…

Should be very handy

comment:4 Changed 14 years ago by Eli Carter

Priority: normallow

While I see the usefulness of this syntax extension (especially for text fields where a user might enter an unrecognized value), the patch eliminates the error-checking case.

comment:5 Changed 4 years ago by Ryan J Ollos

Owner: Eli Carter deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.