Edgewall Software

Opened 9 years ago

Last modified 8 years ago

#11418 closed enhancement

set_owner_to_self should use author from form or prefs — at Initial Version

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: 1.0.3
Component: ticket system Version:
Severity: normal Keywords: workflow
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


When changing a ticket the author field is populated from prefs, that author field value can be replaced by the user, and the value of the author field is used as the ticket change author. However, when accepting a ticket, the set_owner_to_self action does not use the author field when consider who the ticket should be assigned to.

The following patch has been lightly tested, but may be a starting point in aligning the behavior of the workflow with the rest of the ticket form.

  • trac/ticket/default_workflow.py

    diff --git a/trac/ticket/default_workflow.py b/trac/ticket/default_workflow.py
    index 952437a..52d1a63 100644
    a b from trac.env import IEnvironmentSetupParticipant  
    2929from trac.perm import PermissionSystem
    3030from trac.ticket.api import ITicketActionController, TicketSystem
    3131from trac.ticket.model import Resolution
     32from trac.util import get_reporter_id
    3233from trac.util.text import obfuscate_email_address
    3334from trac.util.translation import _, tag_, cleandoc_
    3435from trac.web.chrome import Chrome, add_script, add_script_data
    Read TracWorkflow for more information (don't forget to 'w  
    285286                               "%(current_owner)s to the selected user",
    286287                               current_owner=current_owner))
    287288        elif 'set_owner_to_self' in operations and \
    288                 ticket._old.get('owner', ticket['owner']) != req.authname:
     289                ticket._old.get('owner', ticket['owner']) != \
     290                        get_reporter_id(req, 'author'):
    289291            hints.append(_("The owner will be changed from %(current_owner)s "
    290292                           "to %(authname)s", current_owner=current_owner,
    291                            authname=req.authname))
     293                           authname=get_reporter_id(req, 'author')))
    292294        if 'set_resolution' in operations:
    293295            if 'set_resolution' in this_action:
    294296                resolutions = [x.strip() for x in
    Read TracWorkflow for more information (don't forget to 'wik  
    364366                    newowner = newowner[0]
    365367                updated['owner'] = newowner
    366368            elif operation == 'set_owner_to_self':
    367                 updated['owner'] = req.authname
     369                updated['owner'] = get_reporter_id(req, 'author')
    368370            elif operation == 'del_resolution':
    369371                updated['resolution'] = ''
    370372            elif operation == 'set_resolution':

Change History (0)

Note: See TracTickets for help on using tickets.