Option for Priority labels

I was going to investigate adding an option (config.pm) to select the
presentation of the case priority as a label name rather than (just) as
a raw number. Internally, it would remain the same, but when this option is
enabled, it will display specified labels (also in the config.pm) instead
or in addition to the numeric setting, and pull-downs would be offered to
change the priority by these (custom) labels :

# e.g. labels to use; Low < 20; General < 40; High < 60; etc...
%PriorityLabels = { 'None' => 0, 'Low' => 1, 'General' => 20,
                        'High' => 40, 'Zesty' => 60, 'FireHot' => 80 };

$PriorityType = 0;   # 0 - integer; 1 - labels; other - both

Any thoughts/comments on this hack ?

regards,
-eric
Fujitsu Processor Technologies, Inc.
(Lawrence System Integration, Inc.)

I was going to investigate adding an option (config.pm) to select the
presentation of the case priority as a label name rather than (just) as
a raw number. Internally, it would remain the same, but when this option is
enabled, it will display specified labels (also in the config.pm) instead
or in addition to the numeric setting, and pull-downs would be offered to
change the priority by these (custom) labels :

e.g. labels to use; Low < 20; General < 40; High < 60; etc…

%PriorityLabels = { ‘None’ => 0, ‘Low’ => 1, ‘General’ => 20,
‘High’ => 40, ‘Zesty’ => 60, ‘FireHot’ => 80 };

$PriorityType = 0; # 0 - integer; 1 - labels; other - both

Any thoughts/comments on this hack ?

My thought is “Let me give you mine first”. I’ve already done what
you’ve described, but without PriorityType. I haven’t sat down and
separated out our local modifications feature by feature, but I’ll try
to do so for this one today or tonight.

Mine doesn’t

  • handle ranges, if you use bubbling priority – in fact,
    let’s call priority settings not corresponding to labels
    “undefined behaviour” :slight_smile:
  • use FinalPriority at all
  • let you turn it off

-Rich

Rich Lafferty --------------±----------------------------------------------
Ottawa, Ontario, Canada | Save the Pacific Northwest Tree Octopus!
http://www.lafferty.ca/ | Save The Pacific Northwest Tree Octopus
rich@lafferty.ca -----------±----------------------------------------------

My thought is “Let me give you mine first”. I’ve already done what
you’ve described, but without PriorityType. I haven’t sat down and
separated out our local modifications feature by feature, but I’ll try
to do so for this one today or tonight.

Mine doesn’t

  • handle ranges, if you use bubbling priority – in fact,
    let’s call priority settings not corresponding to labels
    “undefined behaviour” :slight_smile:
  • use FinalPriority at all
  • let you turn it off

Too l8… forgive me :frowning: Right after posting i went straight to work,
and wrapped it up by late afternoon, comes up very clean tho. yay! :slight_smile:
Check it out …

This patch changes the presentation and selection of ticket/queue
priorities to user-defined labels and menu pull-downs. It does not make
any changes to the database or the tickets themselves, just the Web
front-end. Thus it should still work with existing priority escalation
schemes (EscalatePriority.pm); it was coded to avoid ticket priorities
from getting "snap"ed back to their base priority value. It can be
turned on and off at will (with a web server restart in between). We’ll
be using this feature heavily; would love to see this or similar added
into the main distro. if anything, less hacking for me with each
release :slight_smile:

Presentation of priorities is controlled in “config.pm” :

# How to display ticket priority
#  This can change to/from anytime; presentation only & doesn't affect the
#   database; must restart web server to take effect
#  0 - DEFAULT: integer value  (0-99)
#  1 - use label values (as seen in %PriorityLabels)
# >1 - use label values, but also display ## (eg "General/35")
#       if using "bubbling priorities", good to set this
$PriorityType = 1;

# Priority labels; 1 >= Low < 20; 20 >= General < 40; 40 >= High < 60; etc..
%PriorityLabels = ( 'None' => 0, 'Low' => 1, 'General' => 20,
                    'High' => 40, 'Critical' => 60, 'Fatal' => 99 );
# (leave @PrioritySortedKeys alone; used to set label for priorities)
@PrioritySortedKeys = reverse sort { $PriorityLabels{ $a } <=>
                                     $PriorityLabels{ $b } }
                              keys %PriorityLabels;

Might also be valuable to add an additional column to the display when using
this (or just otherwise when tracking priority is important, but change
‘PriorityAsString’ to just ‘Priority’ if not using this patch) :

 QueueListingCols =>
  [
   { Header     => 'Id',
     TicketLink => 1,
     TicketAttribute => 'Id'
     },
  • { Header => ‘Priority’,
  •   TicketAttribute => 'PriorityAsString'
    
  •   },
    
    { Header => ‘Subject’,
    TicketAttribute => ‘Subject’
    },

The patch here is based on 2.0.11 release into an installed system,
assuming it survives e-mail mangling (with tabs n’ all). To patch the
build tree, simply symlink webrt → WebRT, and . → WebRT/html .

jeers,
-eric

( cd /topof/RT; …/gnu/bin/patch -p1 < /tmp/rt.patch )

*** ./WebRT/html/Admin/Elements/ModifyQueue-old Tue Nov 6 17:06:10 2001
— ./WebRT/html/Admin/Elements/ModifyQueue Tue Feb 26 20:23:16 2002
*** 26,36 ****

Priority starts at: ! Over time, priority moves toward: ! --- 26,36 ---- Priority starts at: ! Over time, priority moves toward: ! *** ./WebRT/html/Admin/Queues/Modify.html-old Mon Dec 3 18:13:24 2001 --- ./WebRT/html/Admin/Queues/Modify.html Tue Feb 26 20:47:09 2002 *** 37,47 **** Priority starts at: ! Over time, priority moves toward: ! --- 37,57 ---- Priority starts at: ! ! % if ($RT::PriorityType) { ! <& /Elements/SelectPriority, Name => "InitialPriority", Default => $QueueObj->InitialPriority &> ! % } else { ! ! % } Over time, priority moves toward: ! ! % if ($RT::PriorityType) { ! <& /Elements/SelectPriority, Name => "FinalPriority", Default => $QueueObj->FinalPriority &> ! % } else { ! ! % } *** ./WebRT/html/Elements/SelectPriority-old Sun Nov 4 17:04:00 2001 --- ./WebRT/html/Elements/SelectPriority Wed Feb 27 13:31:21 2002 *** 0 **** --- 1,33 ---- + %# + + % foreach $priidx (@RT::PrioritySortedKeys) { + % my($value)=$RT::PriorityLabels{$priidx}; + % my($prilabel)=$priidx; + % if ( $priidx eq $defprilabel ) { + % $prilabel .= "/".$defprivalue if ($RT::PriorityType > 1); + <%$prilabel%> + % } else { + % $prilabel .= "/".$value if ($RT::PriorityType > 1); + <%$prilabel%> + % } + % } + + <%ARGS> + $Name => undef + $Default => undef + + <%INIT> + my($priidx,$defprilabel,$defprivalue); + foreach $priidx (@RT::PrioritySortedKeys) { + if ( $Default >= $RT::PriorityLabels{$priidx}) { + # save current equivalent priority label + $defprilabel=$priidx; + # save current priority value to prevent tickets from having + # their priorities "snap"ed to closest level + $defprivalue=$Default; + last; + } + } + *** ./WebRT/html/Search/Bulk.html-old Tue Nov 6 17:07:01 2001 --- ./WebRT/html/Search/Bulk.html Tue Feb 26 19:52:20 2002 *** 74,80 **** --- 74,84 ----
  • Make subject + % if ($RT::PriorityType) { +
  • Make priority <& /Elements/SelectPriority, Name => "Priority" &> + % } else {
  • Make priority + % }
  • Make queue <& /Elements/SelectQueue, Name => "Queue" &>
  • Make Status <& /Elements/SelectStatus, Name => "Status" &> *** 117,123 **** map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS);

    my ($bgcolor, @results);
    ! my @cols = qw(id Status Priority Subject QueueObj->Name OwnerObj->Name RequestorsAsString DueAsString );

    Abort(“No search to operate on”) unless ($session{‘tickets’});

    — 121,127 ----
    map ($ARGS{$} =~ /^$/ && (delete $ARGS{$}), keys %ARGS);

    my ($bgcolor, @results);
    ! my @cols = qw(id Status PriorityAsString Subject QueueObj->Name OwnerObj->Name RequestorsAsString DueAsString );

    Abort(“No search to operate on”) unless ($session{‘tickets’});

    *** ./WebRT/html/Search/PickRestriction-old Tue Nov 6 17:07:00 2001
    — ./WebRT/html/Search/PickRestriction Tue Feb 26 19:55:35 2002
    *** 30,36 ****
    — 30,40 ----

  • Priority <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &>
    • % if ($RT::PriorityType) {

    • <& /Elements/SelectPriority, Name => ‘ValueOfPriority’ &>

    • % } else {

    • % }

    *** ./WebRT/html/SelfService/Display.html-old Tue Nov 6 17:07:02 2001
    — ./WebRT/html/SelfService/Display.html Tue Feb 26 19:10:48 2002
    *** 54,60 ****
    Priority


    ! <%$Ticket->Priority %>

    — 54,60 ----
    Priority


    ! <%$Ticket->PriorityAsString() %>

    *** ./WebRT/html/Ticket/Elements/EditBasics-old Tue Nov 6 17:07:00 2001
    — ./WebRT/html/Ticket/Elements/EditBasics Tue Feb 26 18:43:36 2002
    *** 29,35 ****

    <& /Elements/ShadedBox, title => 'Priority', ! content => "Priority."\" SIZE=3>" &> --- 29,35 ---- <& /Elements/ShadedBox, title => 'Priority', ! content => $RT::PriorityType ? $SelectPriority : "Priority."\" SIZE=3>" &> *** 36,42 **** <& /Elements/ShadedBox, title => 'Final Priority', ! content => "FinalPriority."\" SIZE=3>" &>

    — 36,42 ----

    <& /Elements/ShadedBox, title => 'Final Priority', ! content => $RT::PriorityType ? $SelectFinalPriority : "FinalPriority."\" SIZE=3>" &>

    *** 53,58 ****
    — 53,60 ----
    <%INIT>
    #It’s hard to do this inline, so we’ll preload the html of the selectstatus in here.
    my $SelectStatus = $m->scomp(“/Elements/SelectStatus”, Name => ‘Status’, Default=> $TicketObj->Status);

    • my $SelectPriority = $m->scomp(“/Elements/SelectPriority”, Name => ‘Priority’, Default=> $TicketObj->Priority);

    • my $SelectFinalPriority = $m->scomp(“/Elements/SelectPriority”, Name => ‘FinalPriority’, Default=> $TicketObj->FinalPriority);
      my $SelectQueue = $m->scomp(“/Elements/SelectQueue”, Name => ‘Queue’, Default =>$TicketObj->QueueObj->Id);

      </%INIT>
      *** ./WebRT/html/Ticket/Elements/ShowBasics-old Tue Nov 6 17:07:10 2001
      — ./WebRT/html/Ticket/Elements/ShowBasics Tue Feb 26 18:59:03 2002
      *** 9,15 ****
      <& /Elements/ShadedBox, title => ‘Worked’ , content => $TimeWorked ." min" &>

    ! <& /Elements/ShadedBox, title => ‘Priority’, content=> $Ticket->Priority.“/”.$Ticket->FinalPriority &>


    <& /Elements/ShadedBox, title => ‘Queue’, content=> $Ticket->QueueObj->Name &>
    — 9,15 ----
    <& /Elements/ShadedBox, title => ‘Worked’ , content => $TimeWorked ." min" &>


    ! <& /Elements/ShadedBox, title => ‘Priority’, content=> $Ticket->PriorityAsString().“/”.$Ticket->FinalPriorityAsString() &>


    <& /Elements/ShadedBox, title => ‘Queue’, content=> $Ticket->QueueObj->Name &>
    *** ./lib/RT/Queue.pm-old Fri Dec 14 13:03:08 2001
    — ./lib/RT/Queue.pm Tue Feb 26 20:20:50 2002
    *** 752,757 ****
    — 752,782 ----

    }}}

    • sub InitialPriorityAsString {

    • my $self=shift;
      
    • return priorityString($self->InitialPriority)
      
    • }

    • sub FinalPriorityAsString {

    • my $self=shift;
      
    • return priorityString($self->FinalPriority)
      
    • }

    • sub priorityString {

    • my $priority=shift;
      
    • if ( $RT::PriorityType ) {
      
    •     foreach my $pridx ( @RT::PrioritySortedKeys ) {
      
    •         if ( $priority >= $RT::PriorityLabels{ $pridx } ) {
      
    •             return($pridx."/".$priority) if ( $RT::PriorityType != 1 );
      
    •             return($pridx);
      
    •         }
      
    •     }
      
    •     return "unknown";
      
    • }
      
    • return ($priority);
      
    • }

      {{{ Dealing with keyword selects

      {{{ sub AddKeywordSelect

    *** ./lib/RT/Ticket.pm-old Mon Dec 17 13:26:10 2001
    — ./lib/RT/Ticket.pm Tue Feb 26 20:17:32 2002
    *** 1009,1014 ****
    — 1009,1060 ----
    return ($self->Requestors->EmailsAsString() );
    }

    • =head2 PriorityAsString

    • B String: Various Ticket Priorities as either a string or integer

    • =cut

    • sub PriorityAsString {

    • my $self=shift;
      
    • unless ($self->CurrentUserHasRight('ShowTicket')) {
      
    •     return undef;
      
    • }
      
    • return priorityString($self->Priority)
      
    • }

    • sub InitialPriorityAsString {

    • my $self=shift;
      
    • unless ($self->CurrentUserHasRight('ShowTicket')) {
      
    •     return undef;
      
    • }
      
    • return priorityString($self->InitialPriority)
      
    • }

    • sub FinalPriorityAsString {

    • my $self=shift;
      
    • unless ($self->CurrentUserHasRight('ShowTicket')) {
      
    •     return undef;
      
    • }
      
    • return priorityString($self->FinalPriority)
      
    • }

    • sub priorityString {

    • my $priority=shift;
      
    • if ( $RT::PriorityType ) {
      
    •     foreach my $pridx ( @RT::PrioritySortedKeys ) {
      
    •         if ( $priority >= $RT::PriorityLabels{ $pridx } ) {
      
    •             return($pridx."/".$priority) if ( $RT::PriorityType != 1 );
      
    •             return($pridx);
      
    •         }
      
    •     }
      
    •     return "unknown";
      
    • }
      
    • return ($priority);
      
    • }
      =head2 WatchersAsString

      B String: All Ticket Watchers email addresses as a string

Quoting Eric Berggren ericb@fpt.fujitsu.com [Feb 27, 2002 15:21]:

# (leave @PrioritySortedKeys alone; used to set label for priorities)
@PrioritySortedKeys = reverse sort { $PriorityLabels{ $a } <=>
                                     $PriorityLabels{ $b } }
                              keys %PriorityLabels;

I’m lurking on this thread, but I wanted to make a suggestion
here:

 @PrioritySortedKeys = sort { $PriorityLabels{ $b } <=>
                              $PriorityLabels{ $a } }
                       keys %PriorityLabels;

Save yourself a function call…

(darren)

Language is not neutral. It is not merely a vehicle which carries
ideas. It is itself a shaper of ideas.
– Dale Spender

I have recently upgraded from rt2 to rt-3.2.2. In rt2 I had enjoyed
using a patch by Eric Berggren that replaced the numeric priority
display throughout RT by labelled equivalents. The numeric priorities
can be difficult to use, particularly for those who aren’t using the
progressive priority features of RT and where RT is being used by
non-technical staff. Eric’s patch addressed this problem.

As far as I can see there has been no equivalent patch to rt3, and
(unfortunately) this useful functionality was never rolled into the
main rt3 distribution.

I have modified Eric’s original patch so that it applies to rt-3.2.2.

The patch and installation instructions are available here:
http://www.parliant.com/~cmh/rt/

If it proves useful, I hope this kind of functionality might be
included in the main rt3 distribution in future.

Cheers,
Colin Henein
Parliant Corporation

I’m working with a social service organization that wants
to organize their work per person for about 30 people.

Is it practical to think of creating 2-3 queues each for 30 people.

The queues It would be something like:

  1. calls-JohnS
    projects-JohnS
    misc-JohnS

  2. calls-JaneJ
    projects-JaneJ
    misc-JaneJ

  3. calls-ZenaP
    projects-ZenaP
    misc-ZenaP

Is there other software that is closer to a group viewable todo list than
to a ticket system?

From searching the list archive, it is possible to create a scrip that
auto-assigns a ticket in a particular queue to a particular person…

God has no hands or feet or voice except ours, and
through these, God works. (St. Teresa of Avila)

I would do one queue per person with a custom field for
calls/projects/misc. It could even be one queue if you
base persmissions on ticket ownership.

-ToddOn Sun, Oct 03, 2004 at 09:10:08PM -0400, Dan MacNeil wrote:

I’m working with a social service organization that wants
to organize their work per person for about 30 people.

Is it practical to think of creating 2-3 queues each for 30 people.

The queues It would be something like:

  1. calls-JohnS
    projects-JohnS
    misc-JohnS

  2. calls-JaneJ
    projects-JaneJ
    misc-JaneJ

  3. calls-ZenaP
    projects-ZenaP
    misc-ZenaP

Is there other software that is closer to a group viewable todo list than
to a ticket system?

From searching the list archive, it is possible to create a scrip that
auto-assigns a ticket in a particular queue to a particular person…


God has no hands or feet or voice except ours, and
through these, God works. (St. Teresa of Avila)


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Or, why not 3 queues – for calls, projects, and misc?
Assign the relevant person as owner. That way
you don’t have to create/delete queues as people come and go.
An appropriate queury would separate them just fine.

bobg