Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#299 closed enhancement (fixed)

Email2trac should not set the resolution attribute when creating tickets

Reported by: ruediger.kupper@… Owned by: bas
Priority: minor Milestone: email2trac release 2.6.0
Component: email2trac Version: 2.5.0
Keywords: create new ticket Cc:

Description

What happens:

When creating tickets, email2trac sets the default values for ticket attributes, including the "resolution" attribute. The default value for the "resolution" attribute is "fixed". This leads to the rather strange effect of a new ticket being displayed as: "Ticket #<num> (new defect: fixed)"

What should happen:

email2trac does not set the "resulution" attribute when creating new tickets (that's what trac does when using the web interface). After all, the ticket is not resolved yet. The ticket will then be displayed as: "Ticket #<num> (new defect)

Attachments (0)

Change History (11)

comment:1 Changed 9 years ago by bas

  • Status changed from new to assigned

This has always been a source of discussion. Some people actually want this setting and other find it confusing. You can just set your default value for resolution in the admin tab or set the default in email2trac.conf:

comment:2 Changed 9 years ago by ruediger.kupper@…

Thank you. Obviously I'm one of those who find it confusing. More precisely, it differs from what Trac does when creating a ticket via the web interface. I do not see why the email interface should follow different logic. Question: can email2trac be told not to set the resolution attribute at all? Otherwise, I'd have to introduce resolution state "unresolved" just to indicate that this attribute should not be present.

comment:3 Changed 9 years ago by bas

Your welcome. Which version of trac and email2trac do you use? In the code this situation is covered.

                if (name in ['resolution']) and (value in ['fixed']):
                    value = None 

So there must be something else that is causing the problem. Did you installed some ticket plugins?

comment:4 Changed 9 years ago by ruediger.kupper@…

That looks like just the fix I'd expect! Strange, then I shouldn't see this problem... That's Trac 0.12.3 and email2trac svn rev. 590 (as downloaded from this site).

comment:5 follow-up: Changed 9 years ago by ruediger.kupper@…

Ah! Could localization be the problem? Our trac is localized for German language, so the default resolution actually reads 'erledigt', not 'fixed'.

comment:6 in reply to: ↑ 5 Changed 9 years ago by bas

Replying to ruediger.kupper@…:

Ah! Could localization be the problem? Our trac is localized for German language, so the default resolution actually reads 'erledigt', not 'fixed'.

That could indeed be the problem. You can change the code and see if it fixes your problem.

comment:7 Changed 9 years ago by ruediger.kupper@…

That's it. I changed the code to

            if not field.get('custom'):
                value = self.get_config('ticket', 'default_%s' %(name) )
#                if (name in ['resolution']) and (value in ['fixed']):
                if (name in ['resolution']) and (value in ['erledigt']):
                    value = None 

and it works like expected.

Now, this cannot be the final solution: Different trac-sites use different localizations. Even worse, in localized tracs, individual users can choose which language to use. There might even be sites that use the English default, but choose to change the string "fixed" to something else because it better meets their needs. Hence, testing for a specific string is not adequate. I am not sufficiently versed in trac programming, but I suggest that there may be at least two ways of fixing this:

  1. Do not to test for the string, but for the intention of a resolution (if this is at all possible).
  2. Do not test for the kind of resolution at all. I.e., when a new ticket is created, never set the "resolution" attribute. This would resolve to the following code:
             if not field.get('custom'):
                 value = self.get_config('ticket', 'default_%s' %(name) )
                 if (name in ['resolution']):
                     value = None 
    

comment:8 Changed 9 years ago by bas

i took a look at the TRAC source and this field is skipped if a new ticket is generated. I will also skip it and if people wants to close the ticket immediately when an email is received they can do it with:

  • email2trac.conf

I will adjust the default behaviour as you describe. Just leave the field alone

comment:9 Changed 9 years ago by bas

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

(In [599]) skip trac default setting for resolution can only be set in email2trac.conf, closes #299

comment:10 Changed 9 years ago by ruediger.kupper@…

Fine :-).

comment:11 Changed 9 years ago by bas

  • Milestone set to email2trac release X.X.X

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.