[rt-users] XML & RT
Ruslan U. Zakirov
Ruslan.Zakirov at miet.ru
Thu Jun 9 09:36:57 EDT 2005
Adrian Carter wrote:
> Only reason I mention XML is I want to list queue contents per user etc,
> and want to offer re-formating within the shell of the portal system we
> have. Also would be nice to auto-create, check and resolve ticket
> statuses for processes like provisioning.
>
> *shrug*
>
> REST looks like it will do it, but not sure of a good REST / PERL
> interface. or REST/PHP for that matter. Also the REST documentation is..
> umm.. as far as I can see.. non-existant. Wiki yields nothing, and other
> than using lateral thinking and the Interface directory, theres no
> documentation of the functions.
Yeah, REST is not documented, there is Atom interface on the CPAN -
RT-Client, that has examples in the t/* how to use it.
>
> SOAP seemed doable, since I've done some PHP stuff with SOAP before, and
> the PERL stuff is similar. Once again though, Jesse's SOAP interface was
> written RT 3.0.2 and so dunno about its value against 3.4.2 . if someone
> can enlighten me...
SOUP is not supported any more. It's broken.
>
> I'm open to suggestions....
>
> Howard Jones wrote:
>
>> Adrian Carter wrote:
>>
>>> Can anyone point me towards some documentation of RT and XML?
>>>
>>> I wish to use XML to pull information into a customer management
>>> system and would like to know if there is something more current than
>>> the SOAP interface or if there is docs on the REST interface?
>>>
>>> Also, can someone point me towards a perl module that they have used
>>> to manipulate RT XML data. is XML::Simple sufficent?
>>
>>
>>
>> Must it be XML? Those three questions together kind of imply that all
>> you really want is any kind of interface, and XML is the trendy way to
>> do it... don't mean to sound rude.
>>
>> The different perl XML modules vary wildly in what they do - it really
>> really depends on exactly what you need. Do you need to work with an
>> existing DTD, or have files produced to match some existing output
>> (for some program that has a limited parser, say)? XML::Simple is
>> fiddly for that. It's fine for just reading stuff in though, or for
>> when you are the only consumer of your data. I found perl & XML to be
>> pretty frustrating last time I wanted to do something with it, and
>> ended up using VB.net and some XPath stuff which got it done in an
>> hour. YMMV, and it was about a year ago now.
>>
>> I'd like to know the answer to #2 myself - I think there's a lot that
>> could be done using the REST interface if you could work out how. We
>> have a provisioning database which allows tickets to be created from
>> within it's web interface, and when tickets are closed in RT, the
>> corresponding record in the provisioning database is also updated.
>> That uses the NoAuth mail gateway to submit tickets, and a custom
>> Scrip to update the other way.
>>
>> In case it's of use to anyone:
>>
>> In the provisioning DB:
>>
>> <form target="RT_crosswindow"
>> action="http://www.company.com/rt/REST/1.0/NoAuth/mail-gateway"
>> method="POST">
>> <input type=SUBMIT value="Create RT Ticket"><input type=HIDDEN
>> name="queue" value="9">
>> <TEXTAREA NAME="message" COLS=70 ROWS=6>From: requestor at customer.co.uk
>> Subject: Customer ID xyz
>> Queue: broadband
>> X-DBReference: 5522545
>> </TEXTAREA>
>> </form>
>>
>> (I never did get around to making it a hidden field - the idea was to
>> have just one button).
>>
>> In RT, for the appropriate queue:
>>
>> We use Extract Custom Field Values, to put that X-DBReference: header
>> into a Custom Field. Then,
>>
>> On Create, run the following custom action to tell the PDB that
>> there's a ticket open, and what it's ID is:
>>
>> if($self->TicketObj->FirstCustomFieldValue('DBReference') ne "")
>> {
>> use LWP::Simple qw(get);
>> my $dbref = $self->TicketObj->FirstCustomFieldValue('DBReference');
>> my $state = $self->TransactionObj->NewValue;
>> my $id = $self->TicketObj->id;
>>
>> get("http://intranet.company.com/api/update-trouble-ticket.php?NewState=".$state."&DBReference=".$dbref."&TicketID=".$id);
>>
>>
>> }
>>
>>
>> On Status Change, running the following custom action to tell the PDB
>> that the ticket has closed:
>>
>> if($self->TicketObj->FirstCustomFieldValue('DBReference') ne "")
>> {
>> use LWP::Simple qw(get);
>> my $dbref = $self->TicketObj->FirstCustomFieldValue('DBReference');
>> my $state = $self->TransactionObj->NewValue;
>> my $id = $self->TicketObj->id;
>>
>> get("http://intranet.company.com/api/update-trouble-ticket.php?NewState=".$state."&DBReference=".$dbref."&TicketID=".$id);
>>
>>
>> }
>>
>> Obviously, there's a PHP script on the other side, that's actually
>> updating the database.
>>
>> None of which answers your question, but it's maybe slightly useful :-)
>>
>> Best Regards,
>>
>> Howard
>>
>>
>
More information about the rt-users
mailing list