[rt-users] Take notice: RT-3.x.x and DBD::Oracle-1.23

2009-06-12 Thread Joop
Hello,

I'm currently migrating a couple of servers from Ubuntu to Centos and 
just finished installing rt-3.8.4 and came across a nasty surprise.
make fixdeps installs DBD::Oracle-1.23 but then make initdb has a 
problem inserting the system accounts into the Users table.
The error is an ORA-04043: object Users does not exist
The table does exist, as are the other tables, but the insert fails. A 
little googling got me a hit on a Russian site (Ruslan) which led me to 
install DBD::Oracle-1.22 and then retry the make initdb, after dropping 
it first of course. That did the trick, no problems during inserts anymore.

Normally I would create the user myself and/or do a schema import from 
production and probably be very surprised that somethings didn't work 
anymore through the webgui.

Maybe this should be added to the docs until DBD::Oracle is fixed or 
else the version required should be 1.22 instead of 1.23

Regards,

Joop

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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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


[rt-users] enable ability to forward tickets

2009-06-12 Thread Bashir Jahed
Hi Guys,

 

I am trying to enable the forward option on tickets, it is available on
one of our rt systems but not the other. It appears with the reply /
comment options above the ticket  body.

 

Thanks

Bashir

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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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

[rt-users] Oracle and accented characters

2009-06-12 Thread Joop

All,

I just amended the Wiki (OracleSetup) with the following (last part):
I did try with the defaults but that resulted in ?? instead of a 
accented character. Modifying directly in the database using sqlplus 
went OK but in the webinterface those accented characters went back to 
??. So the problem was with Apache-database
Setting various NLS_LANG parameters and restarting Apache resulted in 
accented characters when the third parameter matched with the database 
characterset. Other combinations should work too as long as the database 
is a superset of the clientside.
Setting the clientside (apache) to the same as the database is the 
easiest way, certainly when both apache and the database are on the same 
server.


Regards,

Joop




   Encoding problem with mod_perl2

(for RedHat http://wiki.bestpractical.com/view/RedHat El5, it can be 
added to /etc/sysconfig/httpd which is sourced by /etc/init.d/httpd)


(remark: that didn't work for me, it does when set to 
AMERICAN_AMERICA.WE8MSWIN1252 which is also my database charset!, see 
also: 
http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm) 




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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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

Re: [rt-users] help in creating Scrips

2009-06-12 Thread rmp dmd

 I changed this

  $TicketsObj-LimitStatus(VALUE = 'new');
 $TicketsObj-LimitStatus(VALUE = 'open');

 to:

 $TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', OPERATOR = '=',
 VALUE = $oa);

 but I'm getting error

 Jun 11 22:13:13 data1 RT: Query error in  (  'CF.' = 'alert'  ) AND (
 'Queue' = 'IT'  ) : Unknown field: CF. at
 /opt/rt3/lib/RT/Tickets_Overlay_SQL.pm line 308.  Stack:
 [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:308]
 [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:482]
 [/opt/rt3/lib/RT/Tickets_Overlay.pm:2641]
 [/opt/rt3/lib/RT/Tickets_Overlay.pm:2314]   [(eval 4308):24]
 [/opt/rt3/lib/RT/ScripAction_Overlay.pm:241]
 [/opt/rt3/lib/RT/Scrip_Overlay.pm:507]
 [/opt/rt3/lib/RT/Scrips_Overlay.pm:192]
 [/opt/rt3/lib/RT/Transaction_Overlay.pm:170]
 [/opt/rt3/lib/RT/Record.pm:1438]   [/opt/rt3/lib/RT/Ticket_Overlay.pm:720]
 [/opt/rt3/lib/RT/Interface/Email.pm:765]
 [/opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway:58]
 (/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:484)


 'm guessing, this is because I do not a CustomField. I attached our RT
 interface. Anybody kindly help, identify the problem.



My RT interface shows some of this information:


 #2345: Re: ** PROBLEM alert - Echo PC02/check_usa is CRITICAL **
*Ticket metadata*
The Basics:
  Id: 2345
 Status: new
 Left: 0 min
 Priority: 60/0
 Queue: IT
   Custom Fields:
  Machine Name: No Value
  Customer: No Value
  People:
  Owner: Nobody
  Requestors: rmp.dmd1...@gmail.com




  Thanks!
 Roehl




   On Thu, Jun 11, 2009 at 3:44 PM, rmp dmd rmp.dmd1...@gmail.com wrote:

 Thank you very much Raed.

 This problem explains while I merging the newly created tickets to a
 ticket with status 'new'  on the top of the list.

 I need to merge new ticket to an existing ticket with subject matching **
 PROBLEM - any words - CRITICAL ** .

 1st request, this is a match: #2316: ** PROBLEM alert - Echo
 PC02/check_usa is CRITICAL **
 2nd request, this is a match: #2317: ** PROBLEM alert - Echo
 PC02/check_usa is CRITICAL **

 The existing ticket has an ID: 2312 with Subject: ** PROBLEM alert - Echo
 PC02/check_usa is CRITICAL **

 I will merge ticket 2316 and 2317 with 2312.

 Somehow this merge to a ticket DRP with ID 720.  This is ticket is on the
 top of IT queue list

 223 Centralize Sever login   open IT
 668 test on Saturn open  IT
 720 DRP   new  IT
 745 Backup - all corporate  open  IT
 873 Image Ken Gen   open  IT
 1135 DSS-3 tapes new  IT

 Below is the script.  I hope somebody can help.

 Thanks!
 Roehl

 my $oa = undef;
  my $Transaction = $self-TransactionObj;
 my $subject = $Transaction-Attachments-First-GetHeader('Subject');
 if ( $subject =~ /\*\* PROBLEM (\w+) - (.*) (\w+) \*\*/ ) {
 $oa = $1;
 #$RT::Logger-debug(Found oa: $oa);
 }
 else { return 1; }

 my $TicketsObj = RT::Tickets-new($RT::SystemUser);
 $TicketsObj-LimitQueue(VALUE = 'IT');
 $TicketsObj-LimitStatus(VALUE = 'new');
 $TicketsObj-LimitStatus(VALUE = 'open');


 if ($TicketsObj-Count == 0) { return 1; }
 my $id = undef;
 while (my $ticket = $TicketsObj-Next) {
 next if $self-TicketObj-Id == $ticket-Id;
 $id = $ticket-Id;
 last;
 }
 $id || return 1;
  $RT::Logger-debug(Merging ticket  . $self-TicketObj-Id .  into $id
 because of OA number match.);
 $self-TicketObj-MergeInto($id);
 1;



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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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

Re: [rt-users] help in creating Scrips

2009-06-12 Thread Raed El-Hames
You answered you are own question , yes you are getting the error 
because you do not have the custom field
Create the custom field and apply it to all queues (unless the scrip 
below is not a global scrip -- but I doubt that--)

Can you explain what you are trying to do, maybe we can help you, I am 
not sure you need to search on custom fields (considering they don't 
exist to begin with)

Roy

rmp dmd wrote:

 I changed this
  
 $TicketsObj-LimitStatus(VALUE = 'new');
 $TicketsObj-LimitStatus(VALUE = 'open');
  
 to:
  
 $TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', OPERATOR
 = '=', VALUE = $oa);
  
 but I'm getting error
  
 Jun 11 22:13:13 data1 RT: Query error in  (  'CF.' = 'alert'  )
 AND (  'Queue' = 'IT'  ) : Unknown field: CF. at
 /opt/rt3/lib/RT/Tickets_Overlay_SQL.pm line 308.  Stack:  
 [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:308]  
 [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:482]  
 [/opt/rt3/lib/RT/Tickets_Overlay.pm:2641]  
 [/opt/rt3/lib/RT/Tickets_Overlay.pm:2314]   [(eval 4308):24]  
 [/opt/rt3/lib/RT/ScripAction_Overlay.pm:241]  
 [/opt/rt3/lib/RT/Scrip_Overlay.pm:507]  
 [/opt/rt3/lib/RT/Scrips_Overlay.pm:192]  
 [/opt/rt3/lib/RT/Transaction_Overlay.pm:170]  
 [/opt/rt3/lib/RT/Record.pm:1438]  
 [/opt/rt3/lib/RT/Ticket_Overlay.pm:720]  
 [/opt/rt3/lib/RT/Interface/Email.pm:765]  
 [/opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway:58] 
 (/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:484)
  
  
 'm guessing, this is because I do not a CustomField. I attached
 our RT interface. Anybody kindly help, identify the problem.
  

  
 My RT interface shows some of this information:
  
  
  #2345: Re: ** PROBLEM alert - Echo PC02/check_usa is CRITICAL **
 *Ticket metadata*
 The Basics:
   Id: 2345
  Status: new
  Left: 0 min
  Priority: 60/0
  Queue: IT
Custom Fields:
   Machine Name: No Value
   Customer: No Value
   People:
   Owner: Nobody
   Requestors: rmp.dmd1...@gmail.com mailto:rmp.dmd1...@gmail.com
  
  
  

 Thanks!
 Roehl

  


 On Thu, Jun 11, 2009 at 3:44 PM, rmp dmd rmp.dmd1...@gmail.com
 mailto:rmp.dmd1...@gmail.com wrote:

 Thank you very much Raed.
  
 This problem explains while I merging the newly created
 tickets to a ticket with status 'new'  on the top of the list.
  
 I need to merge new ticket to an existing ticket with subject
 matching ** PROBLEM - any words - CRITICAL ** .
  
 1st request, this is a match: #2316: ** PROBLEM alert - Echo
 PC02/check_usa is CRITICAL **
 2nd request, this is a match: #2317: ** PROBLEM alert - Echo
 PC02/check_usa is CRITICAL ** 
  
 The existing ticket has an ID: 2312 with Subject: ** PROBLEM
 alert - Echo PC02/check_usa is CRITICAL ** 
  
 I will merge ticket 2316 and 2317 with 2312.
  
 Somehow this merge to a ticket DRP with ID 720.  This is
 ticket is on the top of IT queue list
  
 223 Centralize Sever login   open IT
 668 test on Saturn open  IT
 720 DRP   new  IT
 745 Backup - all corporate  open  IT
 873 Image Ken Gen   open  IT
 1135 DSS-3 tapes new  IT
  
 Below is the script.  I hope somebody can help.
  
 Thanks!
 Roehl
  
 my $oa = undef;
 my $Transaction = $self-TransactionObj;
 my $subject =
 $Transaction-Attachments-First-GetHeader('Subject');
 if ( $subject =~ /\*\* PROBLEM (\w+) - (.*) (\w+) \*\*/ ) {
 $oa = $1;
 #$RT::Logger-debug(Found oa: $oa);
 }
 else { return 1; }

 my $TicketsObj = RT::Tickets-new($RT::SystemUser);
 $TicketsObj-LimitQueue(VALUE = 'IT');
 $TicketsObj-LimitStatus(VALUE = 'new');
 $TicketsObj-LimitStatus(VALUE = 'open');
  
  
 if ($TicketsObj-Count == 0) { return 1; }
 my $id = undef;
 while (my $ticket = $TicketsObj-Next) {
 next if $self-TicketObj-Id == $ticket-Id;
 $id = $ticket-Id;
 last;
 }
 $id || return 1;
 $RT::Logger-debug(Merging ticket  . $self-TicketObj-Id .
  into $id because of OA number match.);
 $self-TicketObj-MergeInto($id);
 1;



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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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


Re: [rt-users] help in creating Scrips

2009-06-12 Thread rmp dmd
I just want to merge new tickets with existing tickets with matching subject
line.

I have been provided with the script below. But getting errors on this line
cause the Custom field is not present.

error $TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', OPERATOR =
'=', VALUE = $oa);

I need to get the ID of the existing ticket and merge the new ticket with
this ID.

The scrip also has $RT::Logger-debug but I can not see anything on
/opt/rt3/var/log/rt.log.  I only see errors on /var/log/messages

I already add on /opt/rt3/etc/RT_SiteConfig.pm

Set($LogToFileNamed , rt.log);
Set($LogToFile  , 'debug');

and set permissions for the file:
touch /opt/rt3/var/log/rt.log
chown apache:apache /opt/rt3/var/log/rt.log
Viewing the debug logs will surely help.

Thanks for all the help
Roehl

# from http://archives.free.net.ph/message/20040319.180325.27528377.en.html
#
# If the subject of the ticket matches a pattern suggesting
# that an OA request number is in the subject AND there is
# an existing ticket is the OAReq queue with a matching
# status field, (that is not this ticket)
# merge this ticket into that ticket
my $oa = undef;
my $Transaction = $self-TransactionObj;
my $subject = $Transaction-Attachments-First-GetHeader('Subject');
if ( $subject =~ /\*\* PROBLEM (\w+) - (.*) (\w+) \*\*/ ) {
$oa = $1;
$RT::Logger-debug(Found oa: $oa);
}
else { return 1; }

my $TicketsObj = RT::Tickets-new($RT::SystemUser);
$TicketsObj-LimitQueue(VALUE = 'IT');
$TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', OPERATOR = '=',
VALUE = $oa);
if ($TicketsObj-Count == 0) { return 1; }
my $id = undef;
while (my $ticket = $TicketsObj-Next) {
next if $self-TicketObj-Id == $ticket-Id;
$id = $ticket-Id;
last;
}
$id || return 1;
$RT::Logger-debug(Merging ticket  . $self-TicketObj-Id .  into $id
because of OA number match.);
$self-TicketObj-MergeInto($id);
1;




On Fri, Jun 12, 2009 at 9:33 AM, Raed El-Hames r...@vialtus.com wrote:

 You answered you are own question , yes you are getting the error because
 you do not have the custom field
 Create the custom field and apply it to all queues (unless the scrip below
 is not a global scrip -- but I doubt that--)

 Can you explain what you are trying to do, maybe we can help you, I am not
 sure you need to search on custom fields (considering they don't exist to
 begin with)

 Roy

 rmp dmd wrote:


I changed this
$TicketsObj-LimitStatus(VALUE = 'new');
$TicketsObj-LimitStatus(VALUE = 'open');
to:
$TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', OPERATOR
= '=', VALUE = $oa);
but I'm getting error
Jun 11 22:13:13 data1 RT: Query error in  (  'CF.' = 'alert'  )
AND (  'Queue' = 'IT'  ) : Unknown field: CF. at
/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm line 308.  Stack:
  [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:308]
  [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:482]
  [/opt/rt3/lib/RT/Tickets_Overlay.pm:2641]
  [/opt/rt3/lib/RT/Tickets_Overlay.pm:2314]   [(eval 4308):24]
  [/opt/rt3/lib/RT/ScripAction_Overlay.pm:241]
  [/opt/rt3/lib/RT/Scrip_Overlay.pm:507]
  [/opt/rt3/lib/RT/Scrips_Overlay.pm:192]
  [/opt/rt3/lib/RT/Transaction_Overlay.pm:170]
  [/opt/rt3/lib/RT/Record.pm:1438]
  [/opt/rt3/lib/RT/Ticket_Overlay.pm:720]
  [/opt/rt3/lib/RT/Interface/Email.pm:765]
  [/opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway:58]
  (/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:484)
'm guessing, this is because I do not a CustomField. I attached
our RT interface. Anybody kindly help, identify the problem.

  My RT interface shows some of this information:
#2345: Re: ** PROBLEM alert - Echo PC02/check_usa is CRITICAL **
 *Ticket metadata*
The Basics:
  Id: 2345
 Status: new
 Left: 0 min
 Priority: 60/0
 Queue: IT
   Custom Fields:
  Machine Name: No Value
  Customer: No Value
  People:
  Owner: Nobody
  Requestors: rmp.dmd1...@gmail.com mailto:rmp.dmd1...@gmail.com

Thanks!
Roehl



On Thu, Jun 11, 2009 at 3:44 PM, rmp dmd rmp.dmd1...@gmail.com
 mailto:rmp.dmd1...@gmail.com wrote:

Thank you very much Raed.
This problem explains while I merging the newly created
tickets to a ticket with status 'new'  on the top of the list.
I need to merge new ticket to an existing ticket with
 subject
matching ** PROBLEM - any words - CRITICAL ** .
1st request, this is a match: #2316: ** PROBLEM alert -
 Echo
PC02/check_usa is CRITICAL **
2nd request, this is a match: #2317: ** PROBLEM alert - Echo
PC02/check_usa is CRITICAL **The existing ticket
 has an ID: 2312 with Subject: ** PROBLEM
alert - Echo PC02/check_usa is CRITICAL **I will
 merge ticket 2316 and 2317 with 2312.
Somehow this merge to a ticket DRP with ID 720.  This is
ticket is on the top of IT queue list
223 Centralize Sever login   open IT

Re: [rt-users] help in creating Scrips

2009-06-12 Thread Raed El-Hames
1- Your error log:
- If you have not a directory /var/log/rt3 , create it and create the 
file rt.log by touch
 touch /var/log/rt3/rt.log
 then make sure its owned by the user:group running the web server 
(apache or whatever)
-if you have not already make sure you have the below line in RT_SiteConfig
  Set($LogDir, '/var/log/rt3');

Then restart httpd

2- Your scrip
Why do you need the CF still does n't make since to me?
In any case for if subject match then merge you can do : 
Global/Scrips/New scrip

Condition: On Create (# so we trigger this when a ticket is created)
Action: User defined
Template: Blank

 in  Custom action preparation code put:
return 1;

in
Custom action cleanup code:
return undef unless ($self-TicketObj-Subject =~ / \*\* PROBLEM (\w+) - 
(.*) (\w+) \*\*/ ) ;
my $subject = $self-TicketObj-Subject()
my $TicketsObj = RT::Tickets-new($RT::SystemUser);
$TicketsObj-LimitQueue(VALUE = 'IT');
$TicketsObj-Limit(FIELD = 'Subject' ,VALUE = $subject , OPERATOR = 
'LIKE' ); #This tries to match on the whole subject line
if ($TicketsObj-Count == 0) { return 1; }
my $id = undef;
while (my $ticket = $TicketsObj-Next) {
next if $self-TicketObj-Id == $ticket-Id;
   $id = $ticket-Id;
   last;
}
$id || return 1;
$RT::Logger-debug(Merging ticket  . $self-TicketObj-Id .  into $id 
because of OA number match.);
$self-TicketObj-MergeInto($id);
1;

Regards;

Roy


rmp dmd wrote:
 I just want to merge new tickets with existing tickets with matching 
 subject line.
  
 I have been provided with the script below. But getting errors on this 
 line cause the Custom field is not present.
  
 error $TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', 
 OPERATOR = '=', VALUE = $oa);
  
 I need to get the ID of the existing ticket and merge the new ticket 
 with this ID.
  
 The scrip also has $RT::Logger-debug but I can not see anything on 
 /opt/rt3/var/log/rt.log.  I only see errors on /var/log/messages
  
 I already add on /opt/rt3/etc/RT_SiteConfig.pm
  
 Set($LogToFileNamed , rt.log);
 Set($LogToFile  , 'debug');
  
 and set permissions for the file:
 touch /opt/rt3/var/log/rt.log
 chown apache:apache /opt/rt3/var/log/rt.log
 Viewing the debug logs will surely help.
  
 Thanks for all the help
 Roehl
  
 # from 
 http://archives.free.net.ph/message/20040319.180325.27528377.en.html
 #
 # If the subject of the ticket matches a pattern suggesting
 # that an OA request number is in the subject AND there is
 # an existing ticket is the OAReq queue with a matching
 # status field, (that is not this ticket)
 # merge this ticket into that ticket
 my $oa = undef;
 my $Transaction = $self-TransactionObj;
 my $subject = $Transaction-Attachments-First-GetHeader('Subject');
 if ( $subject =~ /\*\* PROBLEM (\w+) - (.*) (\w+) \*\*/ ) {
 $oa = $1;
 $RT::Logger-debug(Found oa: $oa);
 }
 else { return 1; }

 my $TicketsObj = RT::Tickets-new($RT::SystemUser);
 $TicketsObj-LimitQueue(VALUE = 'IT');
 $TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', OPERATOR = 
 '=', VALUE = $oa);
 if ($TicketsObj-Count == 0) { return 1; }
 my $id = undef;
 while (my $ticket = $TicketsObj-Next) {
 next if $self-TicketObj-Id == $ticket-Id;
 $id = $ticket-Id;
 last;
 }
 $id || return 1;
 $RT::Logger-debug(Merging ticket  . $self-TicketObj-Id .  into 
 $id because of OA number match.);
 $self-TicketObj-MergeInto($id);
 1;
  


  
 On Fri, Jun 12, 2009 at 9:33 AM, Raed El-Hames r...@vialtus.com 
 mailto:r...@vialtus.com wrote:

 You answered you are own question , yes you are getting the error
 because you do not have the custom field
 Create the custom field and apply it to all queues (unless the
 scrip below is not a global scrip -- but I doubt that--)

 Can you explain what you are trying to do, maybe we can help you,
 I am not sure you need to search on custom fields (considering
 they don't exist to begin with)

 Roy

 rmp dmd wrote:


I changed this
$TicketsObj-LimitStatus(VALUE = 'new');
$TicketsObj-LimitStatus(VALUE = 'open');
to:
$TicketsObj-LimitCustomField(CUSTOMFIELD =
 'OAReqNum', OPERATOR
= '=', VALUE = $oa);
but I'm getting error
Jun 11 22:13:13 data1 RT: Query error in  (  'CF.' =
 'alert'  )
AND (  'Queue' = 'IT'  ) : Unknown field: CF. at
/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm line 308.  Stack:  
[/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:308]
  [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:482]
  [/opt/rt3/lib/RT/Tickets_Overlay.pm:2641]
  [/opt/rt3/lib/RT/Tickets_Overlay.pm:2314]   [(eval 4308):24]
  [/opt/rt3/lib/RT/ScripAction_Overlay.pm:241]
  [/opt/rt3/lib/RT/Scrip_Overlay.pm:507]
  [/opt/rt3/lib/RT/Scrips_Overlay.pm:192]
  [/opt/rt3/lib/RT/Transaction_Overlay.pm:170]
  [/opt/rt3/lib/RT/Record.pm:1438]
  

Re: [rt-users] help in creating Scrips

2009-06-12 Thread rmp dmd
Thanks Raed.

I tried you're script but am getting error.

Jun 12 13:09:54 data1 RT: Scrip 26 Commit failed: Can't locate object method
TicketsObj via package RT::Action::UserDefined at (eval 4184) line 1.
Stack:   [(eval 4184):1]   [/opt/rt3/lib/RT/ScripAction_Overlay.pm:241]
[/opt/rt3/lib/RT/Scrip_Overlay.pm:507]
[/opt/rt3/lib/RT/Scrips_Overlay.pm:192]
[/opt/rt3/lib/RT/Transaction_Overlay.pm:170]
[/opt/rt3/lib/RT/Record.pm:1438]   [/opt/rt3/lib/RT/Ticket_Overlay.pm:720]
[/opt/rt3/lib/RT/Interface/Email.pm:765]
[/opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway:58]
(/opt/rt3/lib/RT/Action/UserDefined.pm:81)

there are also errors that are related to syntax (ie missing ; , Ticketobj
instead of ticketsobj).

This is the scrip that I'm running.

Thanks!

scrip:

return undef unless ($self-TicketsObj-Subject =~ / \*\* PROBLEM (\w+) -
(.*) (\w+) \*\*/ ) ;
my $subject = $self-TicketsObj-Subject();
my $TicketsObj = RT::Tickets-new($RT::SystemUser);
$TicketsObj-LimitQueue(VALUE = 'IT');
$TicketsObj-Limit(FIELD = 'Subject' ,VALUE = $subject , OPERATOR =
'LIKE' ); #This tries to match on the whole subject line
if ($TicketsObj-Count == 0) { return 1; }
my $id = undef;
while (my $ticket = $TicketsObj-Next) {
  next if $self-TicketsObj-Id == $ticket-Id;
 $id = $ticket-Id;
 last;
}
$id || return 1;
$RT::Logger-debug(Merging ticket  . $self-TicketsObj-Id .  into $id
because of OA number match.);
$self-TicketsObj-MergeInto($id);
1;




On Fri, Jun 12, 2009 at 10:31 AM, Raed El-Hames r...@vialtus.com wrote:

 1- Your error log:
 - If you have not a directory /var/log/rt3 , create it and create the file
 rt.log by touch
 touch /var/log/rt3/rt.log
 then make sure its owned by the user:group running the web server (apache
 or whatever)
 -if you have not already make sure you have the below line in RT_SiteConfig
  Set($LogDir, '/var/log/rt3');

 Then restart httpd

 2- Your scrip
 Why do you need the CF still does n't make since to me?
 In any case for if subject match then merge you can do : Global/Scrips/New
 scrip

 Condition: On Create (# so we trigger this when a ticket is created)
 Action: User defined
 Template: Blank

 in  Custom action preparation code put:
 return 1;

 in
 Custom action cleanup code:
 return undef unless ($self-TicketObj-Subject =~ / \*\* PROBLEM (\w+) -
 (.*) (\w+) \*\*/ ) ;
 my $subject = $self-TicketObj-Subject()
 my $TicketsObj = RT::Tickets-new($RT::SystemUser);
 $TicketsObj-LimitQueue(VALUE = 'IT');
 $TicketsObj-Limit(FIELD = 'Subject' ,VALUE = $subject , OPERATOR =
 'LIKE' ); #This tries to match on the whole subject line
 if ($TicketsObj-Count == 0) { return 1; }
 my $id = undef;
 while (my $ticket = $TicketsObj-Next) {
   next if $self-TicketObj-Id == $ticket-Id;
  $id = $ticket-Id;
  last;
 }
 $id || return 1;
 $RT::Logger-debug(Merging ticket  . $self-TicketObj-Id .  into $id
 because of OA number match.);
 $self-TicketObj-MergeInto($id);
 1;

 Regards;

 Roy


 rmp dmd wrote:

  I just want to merge new tickets with existing tickets with matching
 subject line.
  I have been provided with the script below. But getting errors on this
 line cause the Custom field is not present.
  error $TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', OPERATOR
 = '=', VALUE = $oa);
  I need to get the ID of the existing ticket and merge the new ticket with
 this ID.
  The scrip also has $RT::Logger-debug but I can not see anything on
 /opt/rt3/var/log/rt.log.  I only see errors on /var/log/messages
  I already add on /opt/rt3/etc/RT_SiteConfig.pm
  Set($LogToFileNamed , rt.log);
 Set($LogToFile  , 'debug');
  and set permissions for the file:
 touch /opt/rt3/var/log/rt.log
 chown apache:apache /opt/rt3/var/log/rt.log
 Viewing the debug logs will surely help.
  Thanks for all the help
 Roehl
  # from
 http://archives.free.net.ph/message/20040319.180325.27528377.en.html
 #
 # If the subject of the ticket matches a pattern suggesting
 # that an OA request number is in the subject AND there is
 # an existing ticket is the OAReq queue with a matching
 # status field, (that is not this ticket)
 # merge this ticket into that ticket
 my $oa = undef;
 my $Transaction = $self-TransactionObj;
 my $subject = $Transaction-Attachments-First-GetHeader('Subject');
 if ( $subject =~ /\*\* PROBLEM (\w+) - (.*) (\w+) \*\*/ ) {
 $oa = $1;
 $RT::Logger-debug(Found oa: $oa);
 }
 else { return 1; }

 my $TicketsObj = RT::Tickets-new($RT::SystemUser);
 $TicketsObj-LimitQueue(VALUE = 'IT');
 $TicketsObj-LimitCustomField(CUSTOMFIELD = 'OAReqNum', OPERATOR = '=',
 VALUE = $oa);
 if ($TicketsObj-Count == 0) { return 1; }
 my $id = undef;
 while (my $ticket = $TicketsObj-Next) {
 next if $self-TicketObj-Id == $ticket-Id;
 $id = $ticket-Id;
 last;
 }
 $id || return 1;
 $RT::Logger-debug(Merging ticket  . $self-TicketObj-Id .  into $id
 because of OA number match.);
 $self-TicketObj-MergeInto($id);
 1;


   On Fri, Jun 12, 2009 at 9:33 AM, Raed El-Hames r...@vialtus.commailto:
 r...@vialtus.com wrote:

You answered you are 

[rt-users] How NOT to fix missing approval ticket dependencies

2009-06-12 Thread Jeremy Winder
So during a window of an hour when we where restructuring the queues
people could create tickets in to better fit our work-flow, a handful of
tickets where create without the approval ticket. In my infinite wisdom,
which apparent is this |..| much, I had the bright idea of just going
into the PostgreSQL database and creating the needed ticket and links
records. WRONG!!

Two hours later I finally have my mess cleaned up. There for awhile I
couldn't even create addition scrips. So let me tell you the better way
of fixing this.

1) Re-enable the ___Approvals queue, if you have installed RT 3.8.4 and
disabled the queue. It doesn't need to be this queue, just one tickets
won't normally be moved into.

2) Create a 'On Queue Change' scrip that matches your 'On Create' create
approval scrip in the ___Approvals queue.

3) One at a time, take the tickets missing the approval dependency and
move them into the ___Approvals queue. This *correctly* create the
approvals ticket.

4) Be sure to move the tickets back to their original queue, and restore
their owner if there was one. I also suggest adding a comment regarding
why you took someone ticket and moved it all over the place, this keeps
the change control auditors happier. I thought about going in and
removing the attachment records for those changes; but then I reminded
myself that playing in the database got me in this mess in the first
place.

Moral of this story, don't be like Jeremy.

I sure hope this helps someone else from being a dumbass,

Jeremy

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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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


[rt-users] Question re: RT-Extension-CommandByMail

2009-06-12 Thread GravyFace
Looks like using CommandByEmail is going to be extremely useful
(especially for setting ownership of tickets), but I have a couple of
questions:

1. is it stable under 3.8.2?

2. I'm assuming it uses the rt-mailgate (and thus my PostFix aliases),
but to what action is it tied into?  i.e. If I'm setting the owner, I
don't really want commands and/or message to go out as correspondence
or comments for that matter.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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


[rt-users] KDE/Konqueror, RT attachments, and OpenOffice

2009-06-12 Thread BJ Blanchard
I've come across an interesting problem which is not specific to RT, but
is related to viewing certain attachments in RT via the Konqueror
browser - thought I would share my experience here to save others the
pain.  Specifically I think its a bug in Konqueror and I'll be posting
as a bug in bugs.kde.org as well.

A few of my users were complaining about RT being slow - and after some
testing I found that firefox was the issue - and switching them to
konqueror (3.5.10) made a huge difference - its very fast by comparison.

But with konqueror - Ticket attachments for OpenOffice documents (odt,
ods, doc, xls, etc) wouldn't open.  Specifically OpenOffice would
generate this message: Error reading data from the Internet.  Server
error message: 503 Service Unavailable.

After alot of digging, I found that the problem lies in the Exec line in
the system .desktop files.

OpenOffice can handle URLs, so the Exec line is defined under (k)ubuntu
in ooo-writer.desktop as:

Exec=ooffice -writer %U

Konqueror uses kioexec for downloading, which follows the conventions
defined here:
http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html , and 
thus launches OpenOffice with the http URL of the link to the attachment.  
Because there are no authentication credentials, OO cannot access the URL thus 
the 503 error.

Changing the desktop entry to use %f instead of %U fixes the problem
- the file gets saved to a temp directory and OpenOffice launches with a
local document - which is how firefox behaves.

But this breaks things like sftp:// urls because it downloads the file -
even though OpenOffice can handle sftp urls properly.

So konqueror, being both a file browser and a web browser, has adopted a
common approach to URL handling which doesn't work in the real world (of
authenticated web sessions).

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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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

[rt-users] Another RT feature

2009-06-12 Thread rmp dmd
RT experts,

Is it possible to resolve a ticket without sending resolve notification to
requestor?


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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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

Re: [rt-users] Another RT feature

2009-06-12 Thread Chaim Rieger
Yes 

Change the resolve scrip
Sent via BlackBerry from T-Mobile

-Original Message-
From: rmp dmd rmp.dmd1...@gmail.com

Date: Fri, 12 Jun 2009 16:09:12 
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Another RT feature


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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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: sa...@bestpractical.com


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


Re: [rt-users] Another RT feature

2009-06-12 Thread rmp dmd
Thanks chaim.

Good idea.

On Fri, Jun 12, 2009 at 4:10 PM, Chaim Rieger chaim.rie...@gmail.comwrote:

 Yes

 Change the resolve scrip
 Sent via BlackBerry from T-Mobile

 -Original Message-
 From: rmp dmd rmp.dmd1...@gmail.com

 Date: Fri, 12 Jun 2009 16:09:12
 To: rt-users@lists.bestpractical.com
 Subject: [rt-users] Another RT feature


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

 Community help: http://wiki.bestpractical.com
 Commercial support: sa...@bestpractical.com


 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: sa...@bestpractical.com


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

[rt-users] Ignore Email Request

2009-06-12 Thread rmp dmd
Experts,

Is there a way for RT to ignore email request based on subject.

ie  Request subject: failure notice
Request subject: RECOVERY

I do not want ticket to be created. nor merge tickets if there's an existing
one.

I believe scrips will not help but if there'a config file on RT that can do
this.  Some mentioned using the MTA or mail-gateway but I do not have any
idea on how to implement it.


Thanks in advanced!
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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

[rt-users] Entering tabular data into a ticket

2009-06-12 Thread Michael Poole
Is there existing support, a plugin, a recipe, or even any hints for
entering tabular data in a ticket?

The particular application is something like a purchase request.
There are standard fields that apply to the ticket as a whole --
requester, date opened, due date, etc. -- but core data for the ticket
would logically be stored in a table.  In the purchase request case,
some columns might be part description and quantity, and the user
would enter one row for each item type that they need.  We would much
prefer to track the set of items together rather than splitting each
row into a separate ticket.

(Bonus points if columns can be defined in terms of custom fields, to
inherit things like their hyperlink target policies.  I did not see
discussion of this kind of feature in the plugin, extension or wish
lists on the wiki, and the closest I found in the mailing list
archives was an August 2008 post asking something rather different.)

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

Community help: http://wiki.bestpractical.com
Commercial support: sa...@bestpractical.com


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


Re: [rt-users] Email copies of replies to senders

2009-06-12 Thread Dominic Lepiane
Hi Ken,

Thanks for your reply, I think that's what we are looking for.

When I took another look in the mailing list archives, I saw mention of
this being added as a user setting / preference in an email from 2005.  
We couldn't find any such setting in 3.8.3, is this feature available
somewhere?

http://lists.bestpractical.com/pipermail/rt-users/2005-November/035022.html

/// With the notify actor setting of 0, RT won't send mail to the 'actor' -
// the thinking is that you've made the update so you don't need to be notified
// of the update. You can, of course change the setting to 1 in which case you
// will get the mail. Does that answer your question?
//
// This has caused confusion for some of our users who aren't aware of this
// feature and expect to see mail. We are about to introduce a user preference
// that controls this so that the individual can choose what behavior they
// want.
//
// Steve
//
/



Thanks,
- Dominic


Ken Crocker wrote:
 Dominic,

 RT doesn't normally notify the initiator of a transaction, as it 
 would be redundant (plus there is a record of the reply in the ticket 
 history). However, if that is what you want, you need to turn on the 
 Notify Actor setting in your RT_SiteConfig.pm file located at 
 $RTHOME/etc. Hope this helps.

 Kenn
 LBNL

 On 6/11/2009 12:44 PM, Dominic Lepiane wrote:
   
 Hi rt-users,

 I'm not sure where to look for this and I couldn't find where in the
 config or preferences this can be done, but is is possible to have
 replies sent to the replying person?  So if I reply to a ticket, I would
 get a copy of my own reply as well as the other people?

 Thanks,
 - Dominic

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

 Community help: http://wiki.bestpractical.com
 Commercial support: sa...@bestpractical.com


 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: sa...@bestpractical.com


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