Rt api

Hi!

After a long period of using RT as trouble-ticket-system I feel
that it will be great if I can add some automatic events to RT.
But my programming skills are too low to hack yours code :(. But
I think such ability will be usefull for many people and you can
be so please to add some changes to your code :).
The idea is: when something happends (new mail arrived, someone
added some comments, etc), RT, before adding changes to some
ticket, calls external program and sends it all information about
action. Lets say, someone wish to create new ticket in query "test"
via some interface. RT looks if it have robot for this query.
It is ok if RT looks for ~rt/etc/actions/.robot, and
calls this program if it exists. So, RT calls etc/actions/test.robot
and sends it information (as parameters, for example):
new_flag – 1 if this message is about to create new request
id – ticket number (planned ticket number for new request)
operation_code – comment/reply/take/resolve
user – RT login, ‘’ if non-member sent message
area_name
current_status – ‘open’ for new request
requestor
after calling this program, RT sends it (via pipe, for exapmle) subject
of current ticket (1st string for example, ‘’ if RT is about to create
new
request), message subject (2nd string, ‘’ if action is not via email),
and text of request then (after all parsing). And then RT waits for
program
to finish, accepting output from it as commands, like "give ",
"status ", "priority ", and some additional
commands, like
drop – forget about this request, just skip id if request was new
message – from next line message follows. There must be some
terminator at the end of message to allow commands after
it, its important.
can be one of:
owner – send followed message to owner of ticket
members – send followed message to query members
requestor – send followed message as reply to requestor
RT – place followed message to RT instead of
original user’s message

It will be even better if you force users to use perl for those scripts
(what
else can people use to process text??? :), and call my code as function,
giving
it all information as parameters (+3 arrays with default messages to
owner,
members and requestor) and use returning values as 5 arrays (commands,
message
to place into RT and 3 replies).

Thats all actually.
Thank you if you are still reading it at least :slight_smile:

Privyet Dima!

We've actually implemented something like this in RT2.

The difference is that the actions currently only happen after
the transaction is recorded (because most actions depend on the content of
the transaction) Basically, RT2 lets you define “Action” modules that can
do anything you can do within RT. we use them for autoreplies, forwarding
correspondence, etc…It’s not documented very well yet, but it is there.

Spasibo,

JesseOn Tue, Nov 21, 2000 at 08:54:13PM +0300, Dmitry S. Rzhavin wrote:

Hi!

After a long period of using RT as trouble-ticket-system I feel
that it will be great if I can add some automatic events to RT.
But my programming skills are too low to hack yours code :(. But
I think such ability will be usefull for many people and you can
be so please to add some changes to your code :).
The idea is: when something happends (new mail arrived, someone
added some comments, etc), RT, before adding changes to some
ticket, calls external program and sends it all information about
action. Lets say, someone wish to create new ticket in query "test"
via some interface. RT looks if it have robot for this query.
It is ok if RT looks for ~rt/etc/actions/.robot, and
calls this program if it exists. So, RT calls etc/actions/test.robot
and sends it information (as parameters, for example):
new_flag – 1 if this message is about to create new request
id – ticket number (planned ticket number for new request)
operation_code – comment/reply/take/resolve
user – RT login, ‘’ if non-member sent message
area_name
current_status – ‘open’ for new request
requestor
after calling this program, RT sends it (via pipe, for exapmle) subject
of current ticket (1st string for example, ‘’ if RT is about to create
new
request), message subject (2nd string, ‘’ if action is not via email),
and text of request then (after all parsing). And then RT waits for
program
to finish, accepting output from it as commands, like "give ",
"status ", "priority ", and some additional
commands, like
drop – forget about this request, just skip id if request was new
message – from next line message follows. There must be some
terminator at the end of message to allow commands after
it, its important.
can be one of:
owner – send followed message to owner of ticket
members – send followed message to query members
requestor – send followed message as reply to requestor
RT – place followed message to RT instead of
original user’s message

It will be even better if you force users to use perl for those scripts
(what
else can people use to process text??? :), and call my code as function,
giving
it all information as parameters (+3 arrays with default messages to
owner,
members and requestor) and use returning values as 5 arrays (commands,
message
to place into RT and 3 replies).

Thats all actually.
Thank you if you are still reading it at least :slight_smile:


Rt-devel mailing list
Rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

I’m reasonably sure that at least two of the electric blue kangeroos
I saw were real.

Hi,

Have the development team ever considered the benefits of introducing an
RT API ? I’d like to see a HTTP-POST / XML reply interface into the RT
system. This will allow us to :

  • update tickets in an automated way (letting some tickets expire)

  • create tickets when a given event is triggered (i.e. association
    between Nagios and RT for some alerts)

  • build custom reports for IT management.

  • allow us to extend the features of our email interface (e.g. permit
    managers to send control messages to an interface which lets them mark
    jobs against particular users.)

  • allows developers to integrate RT with handheld devices (which we
    really could do with).

Any thoughts ?
-a

There is an RT API called REST:
/opt/rt3/share/html/REST

Roy

Andy Davidson wrote:

Andy, I see where you want to go; a “clean” xml-based Interface would be
nice to have, however you can do most of what you probably want to do
already today with the existing API (perl) or even the rt CLI. All you
need to do is to write a wrapper around them and there you go. Not too
much effort.
I did that for an email-Integration with Lotus Notes, including some
sanity checking and duplicate removal. And I’m no programmer.
/af

Andy Davidson wrote:

There is an RT API called REST:
/opt/rt3/share/html/REST

I posted this exact question (phrased slightly differently)
a couple weeks ago. In my case, REST (used by the cli ‘rt’)
wasn’t comprehensive enough to deal with groups.

Do note that the rt (command line program) uses the
REST interface, and does not have to run on the RT machine.

Todd Chapman pointed out RT::Atom. That looks promising
for my needs, although I haven’t had time to fully investigate.

I was kinda asking about a SOAP-like interface, to deal with
more complex data structures, and Jesse replied that he
prefers the simplicity of the name-value (rfc822-style) forms
used by the current REST interface.

Anyway, looking over your list of needs, only the last
one (interaction with PDAs) would need such an interface.
The key point there is real-time, low-latency. The rest of
your items can tolerate some latency, and so the usual
tools (e.g. the RT perl API) can be used. A few comments below.

  bobg

Have the development team ever considered the benefits of introducing
an RT API ? I’d like to see a HTTP-POST / XML reply interface into
the RT system. This will allow us to :

  • update tickets in an automated way (letting some tickets expire)
 rt-crontool does this.  And you can certainly write what you
 like with the perl API and use cron.
  • create tickets when a given event is triggered (i.e. association
    between Nagios and RT for some alerts)
 An example of nagios using the rt command line for this:

 http://lists.bestpractical.com/pipermail/rt-users/2005-June/031775.html
  • build custom reports for IT management.
 The few times I got into this, I ended up doing my
 own selects.  A web api would not, by itself,
 make this any easier.
  • allow us to extend the features of our email interface (e.g. permit
    managers to send control messages to an interface which lets them mark
    jobs against particular users.)
 I did something very similar.  I modified the RT mail processing
 (based on earlier suggestions by Jesse) to look for certain formats
 and execute commands.  In my case, I needed to populate a custom
 field when certain email came it, and to route it to a queue
 based on field in the email.  It would be trivial to have it
 assign to a particular user, or whatever you needed.  Then I put
 a pipe stage in front of rt-mailgate, to munge what we had
 into what RT would digest.
  • allows developers to integrate RT with handheld devices (which we
    really could do with).
 Here you are asking for an alternate realtime UI.
 The REST interface might well suit you, whether you use it directly
 via http posts, or indirectly by calling the rt command line.
 You can already create, fetch and update tickets.

Hey everyone, looking for a PERL API to query the RT db, specificly to
search for a user see if he is there and if not add him.

Can anyone give me some recommendations and possibly an example? is
RT::Client::REST::User what i should be looking at? using search does not
seem to work

Thanks

Following my last emails it appears that the search capability was not
implemented in REST, so it seems that the only way of adding a user is
without knowing if they are there or not, if the user is there an msg is
returned. The other issue here is that there doesnt seem to be a way of
adding custom fields of users in the request

Any ideas on how to do this?---------- Forwarded message ----------
From: George Beitis george.beitis@googlemail.com
Date: Tue, Jan 20, 2009 at 9:50 AM
Subject: RT API
To: rt-users rt-users@lists.bestpractical.com

Hey everyone, looking for a PERL API to query the RT db, specificly to
search for a user see if he is there and if not add him.

Can anyone give me some recommendations and possibly an example? is
RT::Client::REST::User what i should be looking at? using search does not
seem to work

Thanks

A further comment, custom fields for tickets can be added according to the
documentation here:
http://search.cpan.org/~dmitri/RT-Client-REST/lib/RT/Client/REST/Ticket.pm#CUSTOM_FIELDS

this appears to be inherited from the REST::OBJECT which means REST::USER
should be able to inherit it also, but this does not appear to be the case,
am i wrong in what i am thinking of here?On Tue, Jan 20, 2009 at 1:31 PM, George Beitis <george.beitis@googlemail.com wrote:

Following my last emails it appears that the search capability was not
implemented in REST, so it seems that the only way of adding a user is
without knowing if they are there or not, if the user is there an msg is
returned. The other issue here is that there doesnt seem to be a way of
adding custom fields of users in the request

Any ideas on how to do this?

---------- Forwarded message ----------
From: George Beitis george.beitis@googlemail.com
Date: Tue, Jan 20, 2009 at 9:50 AM
Subject: RT API
To: rt-users rt-users@lists.bestpractical.com

Hey everyone, looking for a PERL API to query the RT db, specificly to
search for a user see if he is there and if not add him.

Can anyone give me some recommendations and possibly an example? is
RT::Client::REST::User what i should be looking at? using search does not
seem to work

Thanks

I’ve gone down the phase 1 route with building a web submission system
for RT customized to our organization using the commandsbyemail
extension. Oddly, I am having periodic problems with it where, some
times, the commands do not get recognized (my guess is that the
developer who created the pages keeps tinkering (and breaking) things,
but that is another issue).

So… my thought for phase 2 is to integrate directly to RT for the
ticket creation, custom category assignments, queue assignment, and the
appropriate notification. Is this even possible?

-Rich

Hello Rich,

I’ve gone down the phase 1 route with building a web submission system
for RT customized to our organization using the commandsbyemail
extension. Oddly, I am having periodic problems with it where, some
times, the commands do not get recognized (my guess is that the
developer who created the pages keeps tinkering (and breaking) things,
but that is another issue).

So… my thought for phase 2 is to integrate directly to RT for the
ticket creation, custom category assignments, queue assignment, and the
appropriate notification. Is this even possible?

Sure, if it’s the same server then you can use perl API or REST.
Otherwise you can use REST to talk to RT from different server. Try to
search in archives and wiki.

-Rich

Best regards, Ruslan.