I am writing a custom dhandler for a CMMS/Work Order system based on
Essentially I have a Work Order Template (an OpenOffice ODT file with
user-defined fields) that I populate with custom fields from an RT
Ticket using command-line XMLstarlet tool.
Everything is working when I store my template document on the file
system… ie. my $file = dirname($m->current_comp->source_file) .
But I want to get the template document from an Asset Custom Field.
From outside of RT, and using LWP::Simple - I can do this - which works:
my $asset = RTx::AssetTracker::Asset->new($RT::SystemUser);
my $cf = RT::CustomFieldValue->new($RT::SystemUser);
$cf = $asset->CustomFieldValues(“File”)->First;
my $id = $cf->Id;
my $url = RT->Config->Get(‘WebPath’) .
Unfortunately from within the dhandler it does not work. There are
authentication issues… ie. it returns the RT login html instead of the
I tried appending “?user=rtuser&pass=rtpassword” to the url, but no
Within RT itself, is there a “LWP::Simple::getstore” equivalent??
Or perhaps more easily put: How do you extract a file from a custom
field and store it on the local file system?