Edgewall Software
Modify

Opened 11 years ago

Closed 5 years ago

Last modified 5 years ago

#7979 closed enhancement (duplicate)

New tickets should be able to default owner to the current user

Reported by: lashchev@… Owned by: Ryan J Ollos
Priority: normal Milestone:
Component: ticket system Version: 0.11.2.1
Severity: normal Keywords:
Cc: leho@… Branch:
Release Notes:
API Changes:

Description

We use Trac very actively to manage our Dev tasks and not just as bug tracking system. We have much more tasks than defects or enhancements and in most of the cases Devs are filing tasks for themselves.

It would be very useful if "default_owner" ticket setting could support value like "$USER" meaning that currently logged-in user is pre-selected in the owner field on the new ticket form.

Attachments (0)

Change History (15)

comment:1 by ebray, 11 years ago

This could also be accomplished with a very simple plugin.

in reply to:  1 comment:2 by anonymous, 11 years ago

Replying to ebray:

This could also be accomplished with a very simple plugin.

There does not seem to be a pre-written plugin for accomplishing this task. I too see a value in supporting the $USER variable in the default_owner section of the ini rather than hacking it into the site template.

comment:3 by Ryan Ollos <ryano@…>, 10 years ago

Cc: ryano@… added

comment:4 by mpotter@…, 10 years ago

Cc: mpotter@… added

comment:5 by Christian Boos, 10 years ago

Keywords: owner USER added
Milestone: next-minor-0.12.xunscheduled

comment:6 by anonymous, 7 years ago

bit ugly, and only tested in limited circumstances, but might help someone…

  • trac/ticket/model.py

    old new class Ticket(object):  
    217217            # _something_ else, even if that something else is blank.
    218218            self['owner'] = default_to_owner
    219219
     220        if self.values.get('owner') == '< reporter >':
     221            default_to_reporter = ''
     222            if self.values.get('reporter'):
     223                default_to_reporter = self['reporter']
     224            self['owner'] = default_to_reporter
     225
    220226        # Perform type conversions
    221227        values = dict(self.values)
    222228        for field in self.time_fields:
Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:7 by Christian Boos, 7 years ago

Milestone: unschedulednext-dev-1.1.x
Owner: set to Christian Boos
Status: newassigned

Or just ... self['owner'] = self.values.get('reporter', '')?

I'm no fan of such kind of special values, but we started the trend with < default >, so…

comment:8 by lkraav <leho@…>, 7 years ago

Cc: leho@… added

comment:9 by Mark Potter <mpotter@…>, 6 years ago

Cc: mpotter@… removed

comment:10 by Ryan J Ollos, 6 years ago

Cc: Ryan J Ollos added; ryano@… removed

comment:11 by Ryan J Ollos, 6 years ago

Requested also in SO:24675086. Implementing the proposed changes in #2045 will allow set_owner_to_self to be used in the <none> -> new transition (comment:38:ticket:2045).

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:12 by Ryan J Ollos, 5 years ago

Milestone: next-dev-1.1.x1.1.3
Owner: changed from Christian Boos to Ryan J Ollos

This ticket will be closed as a duplicate of #2045, but before closing this ticket I'll provide a [ticket-workflow] recipe.

comment:13 by Ryan J Ollos, 5 years ago

Cc: Ryan J Ollos removed
Keywords: owner USER removed
Milestone: 1.1.3
Resolution: duplicate
Status: assignedclosed

With #2045 implemented, the default create actions are:

create = <none> -> new
create.default = 1
create_and_assign = <none> -> assigned
create_and_assign.label = assign
create_and_assign.operations = may_set_owner
create_and_assign.permissions = TICKET_MODIFY

To have the create action assign to the current user, just add:

create.operations = set_owner_to_self

Renaming the action might be appropriate, putting the ticket into either the assigned or accepted state:

create_and_accept = <none> -> accepted
create_and_accept.label = accept
create_and_accept.default = 1
create_and_accept.operations = set_owner_to_self

See ticket #11856 for proposed changes that will replace the [ticket] default_owner option, and particularly comment:3:ticket:11856.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:14 by David Banner <dbwonderchild@…>, 5 years ago

There does not seem to be a pre-written plugin for accomplishing this task. I too see a value in supporting the $USER variable in the default_owner section of the ini rather than hacking it into the site template.

Is the $USER variable supported in the default_owner section yet?

in reply to:  14 comment:15 by Ryan J Ollos, 5 years ago

Replying to David Banner <dbwonderchild@…>:

Is the $USER variable supported in the default_owner section yet?

No, and it probably won't be added. You can achieve the equivalent in Trac 1.1.3 and later as described in comment:13.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.