[rt-users] Ideas on best way to do this?

Ruslan Zakirov ruz at bestpractical.com
Wed Feb 6 18:31:48 EST 2008


What we have:
* User has Organization field
* RT has support for searches like "Requestor.Organization = 'X'"

What you have to do:
* maintain users' field
* replace "More about X" box with "More about X's company Y"

The latter is very easy:
> find . | xargs grep 'More about'
./html/Ticket/Elements/ShowRequestor:    title_raw => loc("More about
[_1]", $name),
> open it in your preferred editor
> find line
$tickets->FromSQL( "Requestor.id = ". $requestor->id ." AND (Status =
'open' OR Status = 'new')" );
> doesn't look similar? replace it with:
if ( $requestor->Organization ) {
     $tickets->FromSQL( "Requestor.Organization = '".
$requestor->Organization ."' AND (Status = 'open' OR Status = 'new')"
);
} else {
     $tickets->FromSQL( "Requestor.id = ". $requestor->id ." AND
(Status = 'open' OR Status = 'new')" );
}
> drop mason cache
> reload a ticket you'll see info about requestor's company tickets if field is filled

it's a beginning not ideal but easy. Homework:
* read about Callbacks as this comp provide it and you can extend RT
in a proper way
* read about cleanly customizing RT
* both available on the wiki
* create an index on users table by organization to avoid slowing down
your system
* improve above change to change title of the box if search by
organization is used
* teach people how to search tickets by organization
* teach people how to save searches and them to "RT at glance"

There are really many ways to improve this to a better solution.

It's not a first time this question has been asked and sure there were
another suggestions and details, but afaik nobody who was interested
havn't yet published info and/or implementation to the wiki or
somewhere else.

On Feb 5, 2008 8:23 PM, Leonid Mamchenkov <leonid at mamchenkov.net> wrote:
> Hello,
>
> On Feb 5, 2008 7:11 PM, Mike Peachey <mike.peachey at jennic.com> wrote:
> > It certainly doesn't seem to make sense, why use the requestor's first
> > ticket as a reference point instead of the requestor account itself?
> [...]
> > Perhaps if you explained why you were looking at doing it this way - an
> > idea as to what you are trying to accomplish..
>
> One of the scenarios I can think about (actually one that I am
> interested in myself) is when you have a number of clients (company
> information with several individuals, phone numbers, etc).  You create
> a ticket for each each client with some custom fields to store
> additional information.  Then all requests from the client are created
> as child tickets, so that you can have a clear picture of what's going
> on by looking at the links of the client ticket.
>
> --
> Leonid Mamchenkov
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>



-- 
Best regards, Ruslan.



More information about the rt-users mailing list