Modify

Opened 13 years ago

Closed 13 years ago

#101 closed enhancement (fixed)

Correctly set custom field default values when creating a ticket

Reported by: ben@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: trunk
Keywords: Cc:

Description

Currently, all ticket custom fields are set to None instead of their proper default values when a ticket is created by email2trac. The patch below fixes the problem

--- email2trac.py.in.txt (saved version)
+++ (current document)
@@ -682,7 +682,13 @@
 
 			# default trac value
 			#
-			value = self.get_config('ticket', 'default_%s' %(name) )
+			if not field.get('custom'):
+				value = self.get_config('ticket', 'default_%s' %(name) )
+			else:
+				value = field.get('value')
+				options = field.get('options')
+				if value and options and value not in options:
+					value = options[int(value)]
 			if self.DEBUG > 10:
 				print 'trac.ini name %s = %s' %(name, value)
 

Attachments (0)

Change History (2)

comment:1 Changed 13 years ago by bas

  • Status changed from new to assigned
  • Type changed from defect to enhancement

Thanks for the patch, it will be applied to the trunk version

comment:2 Changed 13 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed

applied to trunk

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
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.