CustomField sort order with Global CustomFields

Hello,

Start out by first saying that RT is a great product. Compared to every
other ticketing software I’ve ever used, it rocks. It almost makes me
want to sit at my desk all day answering tickets.

We recently updated from RT 3.6.4 to RT 3.8.1. Our users have noticed
that the order of CustomFields has changed on the Basics page. Prior to
upgrading, Global CustomFields were listed first with queue specific
ones listed next. It seems to be reversed now, with all the queue
specific fields being listed first and global CustomFields being listed
at the end.

Everything sorts correctly inside of its own list (ie, queue specific
fields sort correctly amongst themselves). I didn’t see this after
searching the archive and I’m lost as to where to start looking for a
solution.

Thanks in advance for any guidance!

We recently updated from RT 3.6.4 to RT 3.8.1. Our users have noticed
that the order of CustomFields has changed on the Basics page. Prior to
upgrading, Global CustomFields were listed first with queue specific
ones listed next. It seems to be reversed now, with all the queue
specific fields being listed first and global CustomFields being listed
at the end.

Everything sorts correctly inside of its own list (ie, queue specific
fields sort correctly amongst themselves). I didn’t see this after
searching the archive and I’m lost as to where to start looking for a
solution.

I just noticed the somewhat illogical placement myself*, it’s specified
in &RT::CustomFields_Overlay::LimitToGlobalOrObjectId. Change the order

$self->OrderByCols(
    { ALIAS => $self->_OCFAlias, FIELD => 'ObjectId', ORDER => 'DESC' },
    { ALIAS => $self->_OCFAlias, FIELD => 'SortOrder' },
);

to

$self->OrderByCols(
    { ALIAS => $self->_OCFAlias, FIELD => 'ObjectId', ORDER => 'ASC' },
    { ALIAS => $self->_OCFAlias, FIELD => 'SortOrder' },
);

in an overlay.

While there, you might simplify the body to remove the unnecessary $global_only

sub LimitToGlobalOrObjectId {
my $self = shift;

foreach my $id (@_ ? @_ : 0 ) {
    $self->Limit( ALIAS           => $self->_OCFAlias,
                FIELD           => 'ObjectId',
                OPERATOR        => '=',
                VALUE           => $id || 0,
                ENTRYAGGREGATOR => 'OR' );
}
  • After all, globals come first on the Queue Ticket Custom Fields page.
    Cambridge Energy Alliance: Save money. Save the planet.

While there, you might simplify the body to remove the unnecessary $global_only
Sorry, should have stuck with my original there:

my $self = shift;

$self->Limit( ALIAS           => $self->_OCFAlias,
              FIELD           => 'ObjectId',
              OPERATOR        => '=',
              VALUE           => 0,
              ENTRYAGGREGATOR => 'OR' );

foreach my $id (@_) {
    $self->Limit( ALIAS           => $self->_OCFAlias,
                FIELD           => 'ObjectId',
                OPERATOR        => '=',
                VALUE           => $id,
                ENTRYAGGREGATOR => 'OR' );
}

Cambridge Energy Alliance: Save money. Save the planet.