Re: [rt-users] RT Scrip

2013-07-05 Thread Craig Ringer
On 07/02/2013 04:07 AM, Bryon Baker wrote:
 Is there a library of RT-scrips?  If so where can I find it

Personally I think any useful set of scrips should generally be turned
into an extension and published on CPAN.

That's what I've been doing with the ones I've written so far, like
RT::Extension::SMSNotify and RT::Extension::CustomerGroups .

I have another in the pipeline that's more of a collection of generally
useful small scrips, I just need to untangle it from some in-house-only
code.




I'll reproduce my notes on extension creation in case they're useful to
anyone. I really need to convert them to wikia syntax or integrate them
into the current guide. The following uses Redmine wiki markup. Details
of paths are specific to Debian installs of RT.




h1. RT development notes

To test an action without installing it to the DB and hooking it up to a
queue, you can use rt-crontool. Searches can be any TicketSQL, but
sometimes a simple ticket id is useful:

rt-crontool --transaction last --search RT::Search::FromSQL
--search-arg (id = 1033) --action
RT::Action::ConvertRequestorCustomersToGroups

The error messages for compilation and module load errors are not very
informative. If you get errors about I18N or Locale, it' probably
actually your module failing to compile. Test with:


PERL5LIB=/usr/local/share/request-tracker4/lib:/usr/share/request-tracker4/lib
perl -mRT::Action::ConvertRequestorCustomersToGroups

h2. Test script

The following code starts up an RT script you can run arbitrary RT code in.
pre

#!/usr/bin/perl

use Modern::Perl;

BEGIN {
push(@INC, '/usr/share/request-tracker4/lib');
push(@INC, '/usr/local/share/request-tracker4/lib');
}

use strict;
use lib /opt/rt3/lib;
use RT;
use RT::Interface::CLI qw( CleanEnv GetCurrentUser );
use RT::ScripCondition;
use RT::Utils2ndQ;

CleanEnv( );
RT::LoadConfig( );
RT::Init( );
my $user = GetCurrentUser( );
unless( $user-Id ) {
print No RT user found. Please consult your RT administrator.\n;
exit 1;
}
say Current RT::User is in \$user variable. Entering interactive shell.;
/pre

Good for testing scripts and snippets.

You might find it useful to load this in `re.pl` from Perl's
`Devel::REPL`
module:http://search.cpan.org/~ether/Devel-REPL-1.003015/lib/Devel/REPL.pm
(in CPAN) so you can interactively work with RT's API. Just point re.pl
to the file, eg:

pre
bash$ re.pl --rcfile /path/to/rtcmdline.pl
$_ $user-Id
149
$_ $user-Name
SomeUserName
$_
/pre

You'll need the full explicit path; re.pl silently ignores files it
can't find and doesn't search the current directory for rcfiles.

I like to alias this to rtrepl in my bashrc:

pre
alias rtrepl='re.pl --rcfile ~/rtcmdline.pl'
/pre

h2. Manually adding actions to the DB

You can use the following code in an RT script like the above test
script to create an action in the DB:

pre
$sa-Create(
Name = 'ConvertRequestorCustomersToGroups',
Description = 'Convert all customer accounts added as a
requestor into the associated customer group',
ExecModule = 'ConvertRequestorCustomersToGroups',
Argument = 'Requestor'
);
/pre

Argument is optional, though some actions require it. The meaning varies
from action to action.

h2. Packaging RT extensions

The packaging process for RT extensions is rather underdocumented. Most
of it is standard Perl module stuff, though:

h3. Packaging a Perl module

Create a Makefile.PL according to Perl's
Module::Install:http://search.cpan.org/~adamk/Module-Install/lib/Module/Install.pod
 or use the example below, which adds use of

pre
use inc::Module::Install 0.77;
use Module::Install::AutoManifest;
use Module::Install::ReadmeFromPod;


name 'Example-Module';

all_from  'lib/Example/Module.pm';
requires  'Carp'= 0;
# add additional dependencies here
test_requires 'Test::More'  = '0.47';

readme_from 'lib/Example/Module.pm';

auto_manifest;

homepage 'https://github.com/yours/module-example-perl';
bugtracker
'https://rt.cpan.org/Dist/Display.html?Status=ActiveQueue=Module-Example';
repository 'git://github.com/yours/module-example-perl.git';

WriteAll;
/pre

Create a MANIFEST.SKIP like:

pre
\.git/
\.gitignore
.*\.o
pm_to_blib
blib/
README.GIT
MANIFEST.SKIP
Module-Example-.*
\..*\.swp
/pre

Make sure your main module's POD begins like this, replacing
Example::Module with your module package and name:

pre

package Example::Module;

=pod

=head1 NAME

Example::Module - Sample module with package Example::Module

=head1 SYNOPSIS

... code sample here ...

=head1 DESCRIPTION

... descriptive text ...

=head1 LICENSE

The same as for Perl itself

=cut

use 5.010;
use strict;

use vars qw{$VERSION @ISA};
BEGIN {
$VERSION = '1.04';
@ISA = 'Example::Module';
}

/pre

Add this to .gitignore:

pre
blib/
pm_to_blib
Makefile
Makefile.old
*.tar.gz
inc/
MANIFEST
META.yml
README
Module-Example-*
.*.swp
/pre

h2. Additions for RT support

To turn the above into an RT 

Re: [rt-users] RT Scrip

2013-07-02 Thread Ruslan Zakirov
Not really. What are looking for?


On Tue, Jul 2, 2013 at 12:07 AM, Bryon Baker bba...@copesan.com wrote:

 Is there a library of RT-scrips?  If so where can I find it?

 Thanks
 Bryon Baker
 Network Operations Manager
 Copesan - Specialists in Pest Solutions
 800-267-3726  .  262-783-6261 ext. 2296
 bba...@copesan.com
 www.copesan.com
 Servicing North America with Local Care





-- 
Best regards, Ruslan.


Re: [rt-users] RT Scrip

2013-07-02 Thread Bryon Baker
That the issue I have some ideas like routing tickets based on text.  But 
looking at what other people have done gives me ideas on how to extend the 
capabilities of RT.

I did look at this link
http://requesttracker.wikia.com/wiki/Contributions
which gave good information about how the scrips work but it would be nice if 
there was a place people could put their scrips.

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726  •  262-783-6261 ext. 2296
bba...@copesan.commailto:cstep...@copesan.com
www.copesan.comhttp://www.copesan.com/
Servicing North America with Local Care

From: ruslan.zaki...@gmail.com [mailto:ruslan.zaki...@gmail.com] On Behalf Of 
Ruslan Zakirov
Sent: Tuesday, July 02, 2013 5:06 AM
To: Bryon Baker
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] RT Scrip

Not really. What are looking for?

On Tue, Jul 2, 2013 at 12:07 AM, Bryon Baker 
bba...@copesan.commailto:bba...@copesan.com wrote:
Is there a library of RT-scrips?  If so where can I find it?

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726  .  262-783-6261 ext. 2296
bba...@copesan.commailto:bba...@copesan.com
www.copesan.comhttp://www.copesan.com
Servicing North America with Local Care




--
Best regards, Ruslan.


Re: [rt-users] RT Scrip

2013-07-02 Thread Ram

 From: Bryon Baker bba...@copesan.com
 Is there a library of RT-scrips?  If so where can I find it?


A few good sources:
-http://requesttracker.wikia.com  - just search for scrip for examples or
toss in a keyword related to your goal (e.g. requestor)
-http://bestpractical.com/rt/docs/4.0/  - reference docs; all the objects
(e.g. Ticket) which you may want to use in a scrip are documented

Here are some of the active RT maintainers on CPAN - they produce
extensions/plug-ins etc that may help:
-http://search.cpan.org/~falcone/
-http://search.cpan.org/~tsibley/

You can also just search CPAN for RT to get tons of results:
-search.cpan.org

Lastly but still quite tasty is the rt-users history - I use gossamer but
it's archived/indexed by other sites as wel
-http://www.gossamer-threads.com/lists/rt/users/


Re: [rt-users] RT Scrip

2013-07-02 Thread Thomas Sibley
On 07/02/2013 06:37 AM, Bryon Baker wrote:
 it would be nice if there was a place people could put their scrips.

A very good way to distribute custom scrips, actions, and conditions is
to package them up into proper Perl classes and put them in an extension
you publish to CPAN.  That way they're installable and versionable and
don't rely on error-prone copy and paste.



[rt-users] RT Scrip

2013-07-01 Thread Bryon Baker
Is there a library of RT-scrips?  If so where can I find it?

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726  .  262-783-6261 ext. 2296
bba...@copesan.com
www.copesan.com
Servicing North America with Local Care




Re: [rt-users] RT: Scrip IsApplicable died?

2013-02-04 Thread Kevin Falcone
On Fri, Feb 01, 2013 at 09:53:52AM +, Thomas Lau wrote:
 How could I tell? Which one is the core problem?

Plugins would be wrong in your RT_SiteConfig.pm, look there.
Permissions you would check with standard unix tools like ls.

-kevin

 -Original Message-
 From: ruslan.zaki...@gmail.com [mailto:ruslan.zaki...@gmail.com] On Behalf Of 
 Ruslan Zakirov
 Sent: Thursday, January 31, 2013 7:40 PM
 To: Thomas Lau
 Cc: rt-users@lists.bestpractical.com
 Subject: Re: [rt-users] RT: Scrip IsApplicable died?
 
 Hi,
 
 @Plugins options is set incorrectly or permissions on files are incorrect.
 
 On Thu, Jan 31, 2013 at 9:50 AM, Thomas Lau thomas@principleone.com 
 wrote:
  Hi all, after install command by email. Something strange appear on my 
  message log:
 
 
 
  RT: Scrip IsApplicable 43 died. - Require of 
  RT::Condition::SLA_RequireStartsSet failed.#012Can't locate 
  RT/Condition/SLA_RequireStartsSet.pm in @INC (@INC contains:
  /opt/rt4/sbin/../local/lib
  /opt/rt4/local/plugins/RT-Extension-CommandByMail/lib 
  /opt/rt4/sbin/../lib
  /usr/local/lib64/perl5 /usr/local/share/perl5 
  /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl 
  /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at (eval 2487) line 
  3.#012#012Stack:#012  [(eval 2487):3]#012
  [/opt/rt4/sbin/../lib/RT/Scrip.pm:404]#012
  [/opt/rt4/sbin/../lib/RT/Scrips.pm:225]#012
  [/opt/rt4/sbin/../lib/RT/Transaction.pm:179]#012
  [/opt/rt4/sbin/../lib/RT/Record.pm:1493]#012
  [/opt/rt4/sbin/../lib/RT/Ticket.pm:676]#012
  [/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Em
  ail/Filter/TakeAction.pm:531]#012
  [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1664]#012
  [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1481]#012
  [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]#012#012#012Stack
  :#012
  [/opt/rt4/sbin/../lib/RT/ScripCondition.pm:171]#012
  [/opt/rt4/sbin/../lib/RT/Scrip.pm:404]#012
  [/opt/rt4/sbin/../lib/RT/Scrips.pm:225]#012
  [/opt/rt4/sbin/../lib/RT/Transaction.pm:179]#012
  [/opt/rt4/sbin/../lib/RT/Record.pm:1493]#012
  [/opt/rt4/sbin/../lib/RT/Ticket.pm:676]#012
  [/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Em
  ail/Filter/TakeAction.pm:531]#012
  [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1664]#012
  [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1481]#012
  [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]
  (/opt/rt4/sbin/../lib/RT/Scrip.pm:419)
 
 
 
  But SLA_RequireStartsSet.pm is in location of 
  /opt/rt4/local/plugins/RT-Extension-SLA/lib/RT/Condition/SLA_RequireSt
  artsSet.pm
 
 
 
  How could I modify to make the error message disappear ?
 
  Thomas Lau
  Senior Technology Analyst
  Principle One Limited
  27/F Kinwick Centre, 32 Hollywood Road, Central, Hong Kong
  T  +852 3555 2217 F  +852 3555   M  +852 9880 1217
 
  Hong Kong   .   Singapore   .   Tokyo
 
 
 
 
 
 --
 Best regards, Ruslan.


pgpkSdNqST8QX.pgp
Description: PGP signature


Re: [rt-users] RT: Scrip IsApplicable died?

2013-02-01 Thread Thomas Lau
Dear Ruslan,

How could I tell? Which one is the core problem?


-Original Message-
From: ruslan.zaki...@gmail.com [mailto:ruslan.zaki...@gmail.com] On Behalf Of 
Ruslan Zakirov
Sent: Thursday, January 31, 2013 7:40 PM
To: Thomas Lau
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] RT: Scrip IsApplicable died?

Hi,

@Plugins options is set incorrectly or permissions on files are incorrect.

On Thu, Jan 31, 2013 at 9:50 AM, Thomas Lau thomas@principleone.com wrote:
 Hi all, after install command by email. Something strange appear on my 
 message log:



 RT: Scrip IsApplicable 43 died. - Require of 
 RT::Condition::SLA_RequireStartsSet failed.#012Can't locate 
 RT/Condition/SLA_RequireStartsSet.pm in @INC (@INC contains:
 /opt/rt4/sbin/../local/lib
 /opt/rt4/local/plugins/RT-Extension-CommandByMail/lib 
 /opt/rt4/sbin/../lib
 /usr/local/lib64/perl5 /usr/local/share/perl5 
 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl 
 /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at (eval 2487) line 
 3.#012#012Stack:#012  [(eval 2487):3]#012
 [/opt/rt4/sbin/../lib/RT/Scrip.pm:404]#012
 [/opt/rt4/sbin/../lib/RT/Scrips.pm:225]#012
 [/opt/rt4/sbin/../lib/RT/Transaction.pm:179]#012
 [/opt/rt4/sbin/../lib/RT/Record.pm:1493]#012
 [/opt/rt4/sbin/../lib/RT/Ticket.pm:676]#012
 [/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Em
 ail/Filter/TakeAction.pm:531]#012
 [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1664]#012
 [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1481]#012
 [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]#012#012#012Stack
 :#012
 [/opt/rt4/sbin/../lib/RT/ScripCondition.pm:171]#012
 [/opt/rt4/sbin/../lib/RT/Scrip.pm:404]#012
 [/opt/rt4/sbin/../lib/RT/Scrips.pm:225]#012
 [/opt/rt4/sbin/../lib/RT/Transaction.pm:179]#012
 [/opt/rt4/sbin/../lib/RT/Record.pm:1493]#012
 [/opt/rt4/sbin/../lib/RT/Ticket.pm:676]#012
 [/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Em
 ail/Filter/TakeAction.pm:531]#012
 [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1664]#012
 [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1481]#012
 [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]
 (/opt/rt4/sbin/../lib/RT/Scrip.pm:419)



 But SLA_RequireStartsSet.pm is in location of 
 /opt/rt4/local/plugins/RT-Extension-SLA/lib/RT/Condition/SLA_RequireSt
 artsSet.pm



 How could I modify to make the error message disappear ?

 Thomas Lau
 Senior Technology Analyst
 Principle One Limited
 27/F Kinwick Centre, 32 Hollywood Road, Central, Hong Kong
 T  +852 3555 2217 F  +852 3555   M  +852 9880 1217

 Hong Kong   .   Singapore   .   Tokyo





--
Best regards, Ruslan.


Re: [rt-users] RT: Scrip IsApplicable died?

2013-01-31 Thread Ruslan Zakirov
Hi,

@Plugins options is set incorrectly or permissions on files are incorrect.

On Thu, Jan 31, 2013 at 9:50 AM, Thomas Lau thomas@principleone.com wrote:
 Hi all, after install command by email. Something strange appear on my
 message log:



 RT: Scrip IsApplicable 43 died. - Require of
 RT::Condition::SLA_RequireStartsSet failed.#012Can't locate
 RT/Condition/SLA_RequireStartsSet.pm in @INC (@INC contains:
 /opt/rt4/sbin/../local/lib
 /opt/rt4/local/plugins/RT-Extension-CommandByMail/lib /opt/rt4/sbin/../lib
 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
 /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd)
 at (eval 2487) line 3.#012#012Stack:#012  [(eval 2487):3]#012
 [/opt/rt4/sbin/../lib/RT/Scrip.pm:404]#012
 [/opt/rt4/sbin/../lib/RT/Scrips.pm:225]#012
 [/opt/rt4/sbin/../lib/RT/Transaction.pm:179]#012
 [/opt/rt4/sbin/../lib/RT/Record.pm:1493]#012
 [/opt/rt4/sbin/../lib/RT/Ticket.pm:676]#012
 [/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Email/Filter/TakeAction.pm:531]#012
 [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1664]#012
 [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1481]#012
 [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]#012#012#012Stack:#012
 [/opt/rt4/sbin/../lib/RT/ScripCondition.pm:171]#012
 [/opt/rt4/sbin/../lib/RT/Scrip.pm:404]#012
 [/opt/rt4/sbin/../lib/RT/Scrips.pm:225]#012
 [/opt/rt4/sbin/../lib/RT/Transaction.pm:179]#012
 [/opt/rt4/sbin/../lib/RT/Record.pm:1493]#012
 [/opt/rt4/sbin/../lib/RT/Ticket.pm:676]#012
 [/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Email/Filter/TakeAction.pm:531]#012
 [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1664]#012
 [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1481]#012
 [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]
 (/opt/rt4/sbin/../lib/RT/Scrip.pm:419)



 But SLA_RequireStartsSet.pm is in location of
 /opt/rt4/local/plugins/RT-Extension-SLA/lib/RT/Condition/SLA_RequireStartsSet.pm



 How could I modify to make the error message disappear ?

 Thomas Lau
 Senior Technology Analyst
 Principle One Limited
 27/F Kinwick Centre, 32 Hollywood Road, Central, Hong Kong
 T  +852 3555 2217 F  +852 3555   M  +852 9880 1217

 Hong Kong   .   Singapore   .   Tokyo





-- 
Best regards, Ruslan.


[rt-users] RT: Scrip IsApplicable died?

2013-01-30 Thread Thomas Lau
Hi all, after install command by email. Something strange appear on my message 
log:

RT: Scrip IsApplicable 43 died. - Require of 
RT::Condition::SLA_RequireStartsSet failed.#012Can't locate 
RT/Condition/SLA_RequireStartsSet.pm in @INC (@INC contains: 
/opt/rt4/sbin/../local/lib 
/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib /opt/rt4/sbin/../lib 
/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl 
/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at 
(eval 2487) line 3.#012#012Stack:#012  [(eval 2487):3]#012  
[/opt/rt4/sbin/../lib/RT/Scrip.pm:404]#012  
[/opt/rt4/sbin/../lib/RT/Scrips.pm:225]#012  
[/opt/rt4/sbin/../lib/RT/Transaction.pm:179]#012  
[/opt/rt4/sbin/../lib/RT/Record.pm:1493]#012  
[/opt/rt4/sbin/../lib/RT/Ticket.pm:676]#012  
[/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Email/Filter/TakeAction.pm:531]#012
  [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1664]#012  
[/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1481]#012  
[/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]#012#012#012Stack:#012  
[/opt/rt4/sbin/../lib/RT/ScripCondition.pm:171]#012  
[/opt/rt4/sbin/../lib/RT/Scrip.pm:404]#012  
[/opt/rt4/sbin/../lib/RT/Scrips.pm:225]#012  
[/opt/rt4/sbin/../lib/RT/Transaction.pm:179]#012  
[/opt/rt4/sbin/../lib/RT/Record.pm:1493]#012  
[/opt/rt4/sbin/../lib/RT/Ticket.pm:676]#012  
[/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Email/Filter/TakeAction.pm:531]#012
  [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1664]#012  
[/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1481]#012  
[/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61] 
(/opt/rt4/sbin/../lib/RT/Scrip.pm:419)

But SLA_RequireStartsSet.pm is in location of 
/opt/rt4/local/plugins/RT-Extension-SLA/lib/RT/Condition/SLA_RequireStartsSet.pm

How could I modify to make the error message disappear ?
Thomas Lau
Senior Technology Analyst
Principle One Limited
27/F Kinwick Centre, 32 Hollywood Road, Central, Hong Kong
T  +852 3555 2217 F  +852 3555   M  +852 9880 1217
Hong Kong   .   Singapore   .   Tokyo



Re: [rt-users] RT scrip

2012-01-04 Thread Alexander Sagratyan
Thanks Kevin! That's exactly what I am looking for.


04 января 2012, 00:41 от Root Kev root@gmail.com:
Yes there is.  Look at the wiki, specifically look for autoclose nagios 
tickets.http://requesttracker.wikia.com/wiki/AutoCloseOnNagiosRecoveryMessages

You should be able to use that as a starting point to get the kind of scrip 
that you are looking for.

Kevin

On Tue, Jan 3, 2012 at 10:14 AM, Alexander Sagratyan fm100te...@mail.ru wrote:
Hello.

 I am trying to configure RT so that when a new ticket is created/corresponded 
a scrip will check all open ticket subject fields. If there is a match  -  
action is to close/resolve both tickets. Is it possible to create such a custom 
scrip? 
Thanks in advance. 

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5  6, 2012



RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5  6, 2012

Re: [rt-users] RT scrip

2012-01-03 Thread Root Kev
Yes there is.  Look at the wiki, specifically look for autoclose nagios
tickets.
http://requesttracker.wikia.com/wiki/AutoCloseOnNagiosRecoveryMessages

You should be able to use that as a starting point to get the kind of scrip
that you are looking for.

Kevin

On Tue, Jan 3, 2012 at 10:14 AM, Alexander Sagratyan fm100te...@mail.ruwrote:

 Hello.

  I am trying to configure RT so that when a new ticket is
 created/corresponded a scrip will check all open ticket subject fields. If
 there is a match  -  action is to close/resolve both tickets. Is it
 possible to create such a custom scrip?
 Thanks in advance.

 
 RT Training Sessions (http://bestpractical.com/services/training.html)
 * Boston — March 5  6, 2012


RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5  6, 2012

Re: [rt-users] RT Scrip doesn't work

2010-03-29 Thread Wagner Pereira

Hi, Kenn.

My scrip should send an e-mail to user when a ticket were created.

It's configured like this (using the default shipped with RT):

Description: Ticket open - AutoReply
Condition: OnCreate
Action: AutoReply to Requestors
Template: global model - AutoReply
Stage: TransactionCreate

Thanks.

--

Wagner Pereira

PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Tel. (11) 3091-8901



Kenneth Crocker escreveu:

Pereira,

Well, let's see the scrip. Can't comment on what i cant see. Is it a 
global scrip? Queue scrip? Was the transaction a /create/ or an /open/?


Kenn
LBNL

On Fri, Mar 26, 2010 at 11:39 AM, Wagner Pereira 
wpere...@pop-sp.rnp.br mailto:wpere...@pop-sp.rnp.br wrote:


Hi, all.

I have a RT scrip which should to send a template in every time
someone create a ticket (through e-mail, obviously).

Although, I have other scrip which sends a template when the
ticket is closed. That's working OK.

I made a comparison between both and I already read the RT manual,
it seems they are correctly configured.

So, why doesn't RT send an e-mail when the ticket is opened?

Hugs,

-- 


Wagner Pereira

PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Tel. (11) 3091-8901


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com




Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


[rt-users] RT Scrip doesn't work

2010-03-26 Thread Wagner Pereira

Hi, all.

I have a RT scrip which should to send a template in every time someone 
create a ticket (through e-mail, obviously).


Although, I have other scrip which sends a template when the ticket is 
closed. That's working OK.


I made a comparison between both and I already read the RT manual, it 
seems they are correctly configured.


So, why doesn't RT send an e-mail when the ticket is opened?

Hugs,

--

Wagner Pereira

PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Tel. (11) 3091-8901


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] RT scrip question

2008-10-22 Thread Kenneth Crocker
Ruslan,


Thanks. That did it.

Kenn
LBNL

On 10/21/2008 8:31 PM, Ruslan Zakirov wrote:
 Condition: On Create
 Action Code:
 
 $self-TicketObj-Owner - returns owner id
 $self-TicketObj-OwnerObj - returns owner as RT::User object
 
 On Wed, Oct 22, 2008 at 12:58 AM, Kenneth Crocker [EMAIL PROTECTED] wrote:
 To list,


I am trying to capture the ticket owner as the ticket is created (via
 Web) and I'm not sure of how to code that. I know how to ensure that I'm
 checking a WebUI transaction and the transaction creator, but don't know
 how to get the ticket owner on creation. Help?? Thanks.


 Kenn
 LBNL

 ___
 http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

 Community help: http://wiki.bestpractical.com
 Commercial support: [EMAIL PROTECTED]


 Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
 Buy a copy at http://rtbook.bestpractical.com

 
 
 

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


[rt-users] RT scrip question

2008-10-21 Thread Kenneth Crocker
To list,


I am trying to capture the ticket owner as the ticket is created (via 
Web) and I'm not sure of how to code that. I know how to ensure that I'm 
checking a WebUI transaction and the transaction creator, but don't know 
how to get the ticket owner on creation. Help?? Thanks.


Kenn
LBNL

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] RT scrip question

2008-10-21 Thread Ruslan Zakirov
Condition: On Create
Action Code:

$self-TicketObj-Owner - returns owner id
$self-TicketObj-OwnerObj - returns owner as RT::User object

On Wed, Oct 22, 2008 at 12:58 AM, Kenneth Crocker [EMAIL PROTECTED] wrote:
 To list,


I am trying to capture the ticket owner as the ticket is created (via
 Web) and I'm not sure of how to code that. I know how to ensure that I'm
 checking a WebUI transaction and the transaction creator, but don't know
 how to get the ticket owner on creation. Help?? Thanks.


 Kenn
 LBNL

 ___
 http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

 Community help: http://wiki.bestpractical.com
 Commercial support: [EMAIL PROTECTED]


 Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
 Buy a copy at http://rtbook.bestpractical.com




-- 
Best regards, Ruslan.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com