Edgewall Software
Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11090 closed enhancement (fixed)

"Leave" workflow action should have a hint about the current owner

Reported by: ethan.jucovy@… Owned by: Ethan Jucovy <ethan.jucovy@…>
Priority: normal Milestone: 1.0.2
Component: ticket system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Add a hint about the current owner to the leave action in the workflow Action box if leave_status is the only allowed operation for the leave action.

API Changes:

Description (last modified by Christian Boos)

I often find myself wanting to know who is the current owner of a ticket when I am choosing to "leave" a ticket in its current state.

The UI makes this somewhat difficult, because the "Owner" field is not listed in the "Change Properties" box that appears directly above the workflow "Action" box.

In order to double-check who currently owns the ticket, I have to either:

  • scroll back up to the top of the page to review the ticket's current properties
  • wait for the preview to be rendered at the bottom of the page and review the ticket's new properties
  • look at the OTHER workflow actions, like "Reassign", and read through its hint ("The owner will be changed from ethan to …") to see who currently owns the ticket

The last of these methods is the most "efficient" but also seems to be the least intuitive — at least, it never actually occurred to me until I was writing this ticket. :-) As a user I've developed a habit of either scrolling to the top or waiting for the preview in order to check the ticket's current owner whenever I'm "leaving" a ticket in its current state.

Adding a hint to the "leave" action would be an easy solution. If the "leave" action had a hint like "The owner will remain ethan", then I would be able to see the current owner at a glance without needing to think too hard about it:

  • trac/ticket/default_workflow.py

    diff --git a/trac/ticket/default_workflow.py b/trac/ticket/default_workflow.py
    index 6b087ab..631a604 100644
    a b Read TracWorkflow for more information (don't forget to 'wiki upgrade' as well)  
    323323            control.append(_('as %(status)s ',
    324324                             status= ticket._old.get('status',
    325325                                                     ticket['status'])))
     326            hints.append(_("The owner will remain %(current_owner)s",
     327                           current_owner=current_owner))
    326328        else:
    327329            if status != '*':
    328330                hints.append(_("Next status will be '%(name)s'", name=status))

Attachments (0)

Change History (7)

comment:1 by Christian Boos, 7 years ago

Description: modified (diff)
Milestone: 1.0.2
Owner: set to Christian Boos
Status: newassigned

Good idea!

Suggesting the following improvement:

  • default_workflow.py

     
    226226        this_action = self.actions[action]
    227227        status = this_action['newstate']
    228228        operations = this_action['operations']
    229         current_owner = ticket._old.get('owner', ticket['owner'] or '(none)')
     229        current_owner_or_empty = ticket._old.get('owner', ticket['owner'])
     230        current_owner = current_owner_or_empty or '(none)'
    230231        if not (Chrome(self.env).show_email_addresses
    231232                or 'EMAIL_VIEW' in req.perm(ticket.resource)):
    232233            format_user = obfuscate_email_address
     
    323324            control.append(_('as %(status)s ',
    324325                             status= ticket._old.get('status',
    325326                                                     ticket['status'])))
     327            hints.append(_("The owner will remain %(current_owner)s",
     328                           current_owner=current_owner)
     329                         if current_owner_or_empty else
     330                         _("The ticket will remain without an owner"))
    326331        else:
    327332            if status != '*':
    328333                hints.append(_("Next status will be '%(name)s'", name=status))

Not 100% sure about the grammar though (or "with no owner"?).

Also, I hope this will not introduce doubts about what happens with the owner for the other actions where the owner won't change (e.g. assign / unassign / resolve). I don't want to add the "remains" hint for all of them, sounds too verbose. So unless someone has a better idea, I'm fine with the proposed change.

in reply to:  1 ; comment:2 by ethan.jucovy@…, 7 years ago

Replying to cboos:

Not 100% sure about the grammar though (or "with no owner"?).

I guess "The ticket will remain unowned" would be more grammatical. But personally I prefer your version even though it's a little stilted — I think it's useful to leave the word "owner" in the hint so that it's easier to understand what's referred to while scanning the page quickly. In that sense I think "with no owner" is best, because the phrase "no owner" is so easy to spot.

Also, I hope this will not introduce doubts about what happens with the owner for the other actions where the owner won't change (e.g. assign / unassign / resolve). I don't want to add the "remains" hint for all of them, sounds too verbose. So unless someone has a better idea, I'm fine with the proposed change.

I was a little worried about that. I think it's less unclear with those other actions, because they have some hint that says what will change, so it's reasonable to infer that everything unmentioned will be unchanged.

in reply to:  2 ; comment:3 by ethan.jucovy@…, 7 years ago

Replying to ethan.jucovy@…:

I think it's less unclear with those other actions, because they have some hint that says what will change, so it's reasonable to infer that everything unmentioned will be unchanged.

…which made me realize that my patch is completely broken if you customize your workflow at all, e.g.

leave = * -> *
leave.default = 1
leave.operations = leave_status, set_owner

With my patch, this will result in a nonsensical hint like "The owner will be changed from ethan to the selected user. The owner will remain ethan."

Here's a new patch which should avoid that problem, by only appending the new hint if "leave_status" is the ONLY active operation:

  • trac/ticket/default_workflow.py

    diff --git a/trac/ticket/default_workflow.py b/trac/ticket/default_workflow.py
    index 6b087ab..7ad8e97 100644
    a b Read TracWorkflow for more information (don't forget to 'wiki upgrade' as well)  
    226226        this_action = self.actions[action]
    227227        status = this_action['newstate']
    228228        operations = this_action['operations']
    229         current_owner = ticket._old.get('owner', ticket['owner'] or '(none)')
     229        current_owner_or_empty = ticket._old.get('owner', ticket['owner'])
     230        current_owner = current_owner_or_empty or '(none)'
    230231        if not (Chrome(self.env).show_email_addresses
    231232                or 'EMAIL_VIEW' in req.perm(ticket.resource)):
    232233            format_user = obfuscate_email_address
    Read TracWorkflow for more information (don't forget to 'wiki upgrade' as well)  
    323324            control.append(_('as %(status)s ',
    324325                             status= ticket._old.get('status',
    325326                                                     ticket['status'])))
     327            if len(operations) == 1:
     328                hints.append(_("The owner will remain %(current_owner)s",
     329                               current_owner=current_owner)
     330                             if current_owner_or_empty else
     331                             _("The ticket will remain with no owner"))
    326332        else:
    327333            if status != '*':
    328334                hints.append(_("Next status will be '%(name)s'", name=status))

in reply to:  3 comment:4 by Christian Boos, 7 years ago

Resolution: fixed
Status: assignedclosed

Replying to ethan.jucovy@…:

Thanks, applied in r11778.

comment:5 by Christian Boos, 7 years ago

Owner: changed from Christian Boos to Ethan Jucovy <ethan.jucovy@…>

comment:6 by Ryan J Ollos <ryan.j.ollos@…>, 7 years ago

Release Notes: modified (diff)

comment:7 by Ryan J Ollos <ryan.j.ollos@…>, 7 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ethan Jucovy <ethan.jucovy@…>.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Ethan Jucovy <ethan.jucovy@…> 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.