[rt-users] Concatenation of two strings in Query Builder

Kevin Falcone falcone at bestpractical.com
Tue Jun 16 16:55:13 EDT 2009


On Jun 16, 2009, at 6:51 AM, Vincent Beau wrote:

> my RT config needs a dedicated queue for some users.
>
> Each of these queues is named as the following 4<username> (ex: for me
> it would be "4Vincent")
>
> I need to make a general search query giving the message list in the
> user's dedicated queue.
>
> Where I'm stuck is about the syntax in itself.
>
>    Queue = '4'.'__CurrentUser__'
>
> Tells me:
>
>    Wrong query, expecting a AGGREGATOR in 'Queue =
> '4'>.<--here'__CurrentUser__''
>
>    Queue = '4', '__CurrentUser__'
>
> Tells me:
>
>    Wrong query, expecting a AGGREGATOR in 'Queue =
> '4',>'__CurrentUser__'<--here'
>
> I don't get it, does anyone knows how to concatenate two strings in  
> the
> Advanced Query builder ?

A few things.  I don't think you can concat like that, and the code  
looks
for '__CurrentUser__' explicitly, so if the concat worked it would
break the matching.  Also, __CurrentUser__ is substituted with the  
user's
id, not username.

You're better off writing a tiny portlet like Quicksearch where you can
build the query you want using $session{CurrentUser}->Name explicitly
and normal perl substitution.

If you need personal queues, it might be better to just have one queue
that everyone can create tickets in, but you can only view tickets you
Requested or Own.  That way you have one bucket for tickets, but
you can't see each other's tickets.

-kevin





More information about the rt-users mailing list