[rt-users] Asset Tracker: add link to asset from Ticketcustomfield

Patterson, Craig crpatter at ci.grand-rapids.mi.us
Tue Oct 16 13:16:23 EDT 2007


Matthew,

I was trying your method without success.  If I use put
at://[mywebpath]/asset/[assetid] in the "refers to" link, it returns
Couldn't resolve 'at://testhelpdesk/rt/asset/1' into a URI.

If I change "at" to "http", RT accepts it, but it really is just a hyper
link.  If I go to the asset page and look at "referred to by" is blank,
and if I click the link itself from the ticket screen, it opens up a new
window and I get a not found error.

Is there some step I'm missing?

Thanks for any suggestions,

Craig

-----Original Message-----
From: Matthew Keller [mailto:kellermg at potsdam.edu] 
Sent: Tuesday, October 16, 2007 9:39 AM
To: Patterson, Craig
Cc: Franzini, Gabriele [Nervianoms]; rt-users at lists.bestpractical.com
Subject: RE: [rt-users] Asset Tracker: add link to asset from
Ticketcustomfield

What I explained is exactly the same thing, without the need for a
custom field.

On Tue, 2007-10-16 at 09:33 -0400, Patterson, Craig wrote:
> Thanks Matthew and Gabrielle,
> 
> What I was trying to do was a little more complex, I probably didn't
> explain it very well.  I wanted make the asset a "refers to" link from
> the ticket's links page.  Luckily I finally found the solution in our
> old development DB.  The solution required a scrip which I found on
the
> old asset tracker list ages ago...
> 
> Custom Condition:
> my $trans = $self->TransactionObj->Type;
> my $new_value = $self->TransactionObj->NewValue;
> my $cf_id = $self->TransactionObj->Field;
> 
> if ($trans ne 'CustomField') { return 0; }
> if (! $new_value) { return 0; }
> my $cf = new RT::CustomField($RT::SystemUser);
> my ($id,$msg) = $cf->Load($cf_id);
> 
> if (!$id) {
>    $RT::Logger->crit("Could not load CF: $msg");
>    return 0;
> }
> if ($cf->Name ne 'asset') { return 0; }
> 
> 1;
> 
> Custom action preparation code:
> 1;
> 
> Custom action cleanup code:
> my $new_value = $self->TransactionObj->NewValue;
> my $asset = RTx::AssetTracker::Asset->new($self->CurrentUser);
> my ($id,$msg) = $asset->Load($new_value);
> if (! $id) {
>    $RT::Logger->crit("Could not load asset $new_value: $msg");
>    return 0;
> }
> ($id,$msg) = $self->TicketObj->AddLink(Type => 'RefersTo', Target =>
> $asset->URI);
> if (! $id) {
>    $RT::Logger->crit("Could not AddLink: $msg");
>    return 0;
> }
> 1;
> 
> So now I can type in the name of the asset on in Tickets custom field
> and automatically link it to the asset.  What is the benefit?  We
don't
> have to change our ticket creation process for regular user requests,
> ie, from the phone or from email.  Plus, we can look at the asset and
> see all of the tickets associated to it in the "Referred to by" area.
> 
> Craig
>  
> -----Original Message-----
> From: Matthew Keller [mailto:kellermg at potsdam.edu] 
> Sent: Monday, October 15, 2007 10:01 AM
> To: Patterson, Craig
> Cc: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] Asset Tracker: add link to asset from Ticket
> customfield
> 
> In the "refers to" field of the ticket, put
'at://potsdam.edu/asset/66'
> where 'potsdam.edu' is the name of the RT domain, and '66' is the
number
> of the ticket.
> 
> 
> On Fri, 2007-10-12 at 10:57 -0400, Patterson, Craig wrote:
> > Everyone,
> > 
> > I apologize for posting this on the RT list, but I can not find even
> an
> > archive of the old AT list, and I'm sure I've seen the answer to my
> > question there. 
> > 
> > Basically, I want to be able to link a ticket to an asset by putting
> the
> > assets id in a custom field for the ticket.  I recall that it was
> quite
> > simple.  You needed to put in a value in the "Link values to" for
the
> > tickets custom field, I just don't recall for the format was.
> 
> 




More information about the rt-users mailing list