($ret, $msg) = $queue_obj->Create(Name => $queue,
Description => 'queue for custom field sort testing');
ok($ret, "$queue test queue creation. $msg");
($ret, $msg) = $queue_obj->Create(Name => $queue,
Description => 'queue for custom field sort testing');
ok($ret, "$queue test queue creation. $msg");
($ret, $msg) = $me->Create(Name => "Me$$", EmailAddress => $$.'create-me-1@example.com');
($ret, $msg) = $me->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'OwnTicket');
($ret, $msg) = $me->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'SeeQueue');
($ret, $msg) = $me->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'ShowTicket');
($ret, $msg) = $me->Create(Name => "Me$$", EmailAddress => $$.'create-me-1@example.com');
($ret, $msg) = $me->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'OwnTicket');
($ret, $msg) = $me->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'SeeQueue');
($ret, $msg) = $me->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'ShowTicket');
($ret, $msg) = $you->Create(Name => "You$$", EmailAddress => $$.'create-you-1@example.com');
($ret, $msg) = $you->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'OwnTicket');
($ret, $msg) = $you->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'SeeQueue');
($ret, $msg) = $you->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'ShowTicket');
($ret, $msg) = $you->Create(Name => "You$$", EmailAddress => $$.'create-you-1@example.com');
($ret, $msg) = $you->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'OwnTicket');
($ret, $msg) = $you->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'SeeQueue');
($ret, $msg) = $you->PrincipalObj->GrantRight(Object =>$queue_obj, Right => 'ShowTicket');
# Make sure we can sort in both directions on a queue specific field.
$metx->FromSQL(qq[queue="$queue"] );
$metx->OrderBy( FIELD => "Custom.Ownership", ORDER => 'ASC' );
# Make sure we can sort in both directions on a queue specific field.
$metx->FromSQL(qq[queue="$queue"] );
$metx->OrderBy( FIELD => "Custom.Ownership", ORDER => 'ASC' );
# Make sure we can sort in both directions on a queue specific field.
$youtx->FromSQL(qq[queue="$queue"] );
$youtx->OrderBy( FIELD => "Custom.Ownership", ORDER => 'ASC' );
# Make sure we can sort in both directions on a queue specific field.
$youtx->FromSQL(qq[queue="$queue"] );
$youtx->OrderBy( FIELD => "Custom.Ownership", ORDER => 'ASC' );