[rt-users] Add requestor organization to columns from search results

Kevin Falcone falcone at bestpractical.com
Thu Apr 4 11:37:07 EDT 2013


On Thu, Apr 04, 2013 at 12:21:35PM +0200, Bart wrote:
>    I'm curious to know if it's possible to add the requestor organization to a column.
>    Right now you can show the column __Requestors__ which works, and shows all requestores
>    belonging to a ticket.
>    And another thing that's possible a.t.m. is searching on the requestor organization using this
>    in your ticketsql:
>    Requestor.Organization LIKE 'Bestpractical'
>    Trying to add __Requestor.Organization__ or __RequestorOrganization__ to the columns (using
>    advanced view) doesn't seem to work. It adds the column but no information is shown.
>    Since it's a searchable item, is there a way to display the Requestor(s) Organization in a
>    column?

There isn't a default Format for arbitrary Requestor information.
It would actually be possible to look at the code in
share/html/Elements/RT__Ticket/ColumnMap used by $LinkCallback to
implement code so that __Requestors.{Anything}__ would work, but
that's actually kind of complicated if you're not already familiar
with the level of magic in ColumnMap.

What you probably want to do is use the Once callback in
share/html/Elements/RT__Ticket/ColumnMap and copy the entry for
Requestors earlier in the file and define

Requestors.Organization => {
    title     => 'Requestors Organization', # loc
    attribute => 'Requestor.Organization',
    value     => sub { return
                      $_[0]->Requestors-> # more code to loop and get the Organzation
                      }
},

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130404/34bf25e6/attachment.sig>


More information about the rt-users mailing list