Re: [rt-users] round-robin auto assignment?

2015-10-22 Thread Asif Iqbal
On Thu, Oct 22, 2015 at 11:12 AM, Asif Iqbal  wrote:

>
>
> On Fri, Apr 12, 2013 at 2:22 PM, Thomas Sibley 
> wrote:
>
>> On 04/12/2013 11:06 AM, Doug Eubanks wrote:
>> > I apologize, but Perl isn't my strong suit.  :D
>> >
>> > Changing those three lines still compiles and updates the scrip, but it
>> > doesn't do anything and never assigns the ticket to anyone now.
>>
>> Oh, I see, the previous code was trying to set the owner as the next
>> user in the array (but may have set an undef owner if the current owner
>> was the last one in the array).
>>
>> I think you'll need to update the code to set $new_owner to the next
>> owner instead of a random one.  I haven't fully read the scrip though,
>> so there may be an underlying more fundamental problem.
>>
>
>
> I were able to get it working with modulo. Here is the complete scrip we
> are running since today and so far looks good. Any suggestion is welcome to
> improve it.
>
> I used modulo to pick the next owner. Besides that rest of the code is
> from http://requesttracker.wikia.com/wiki/AutoSetOwner
>
> Description: Auto assign ticket on create
> Condition: On Create
> Action: User Defined
> Template: Global template: Blank
> Stage: TransactionCreate
>
> Custom condition: return 1;
> Custom action preparation code: return 1;
> Custom action cleanup code:
> # get out if ticket has a owner
> return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
>
> # gather the list of owners
> my @owners = qw(
> foo
> bar
> qaz
> );
>
> # get a count for the owners
> my $totmembers = scalar( @owners );
>
> # get this ticket id
> my $ticket_id = $self->TicketObj->id;
>
> # ticket_id modulo totmembers to pick the next owner
> my $x =  $ticket_id % $totmembers;
> my $owner = $owners[$x];
>
> # set the owner
> $RT::Logger->info("Auto assign ticket ". $self->TicketObj->id ." to user
> ". $owner );
> my ($status, $msg) = $self->TicketObj->SetOwner( $owner );
> unless( $status ) {
> $RT::Logger->error( "Impossible to assign the ticket to $owner: $msg"
> );
> return undef;
> }
> return 1;
>
>

some change in the cleanup code

# if you want to disable it, just uncomment the following line
# return 1;

# get out if ticket has a owner
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;

# get the user list from the file
# this file has the list of users who will be assigned as owner in
round-robin
# you could have another logic external that could update this file to get
the
# generate the list of owners
my $file = "/var/tmp/ownerlist";

return 1 unless open(my $fh, '<', $file);
my @owners = <$fh>;
return 1 unless close $fh;

# sanitizing the entries - accounts should be all alphanumerics
foreach my $line (@owners) {
 $line =~ tr/A-Za-z0-9//cd;
}


# get a count for the owners
my $totmembers = scalar( @owners );

# get this ticket id
my $ticket_id = $self->TicketObj->id;

# ticket_id modulo totmembers to pick the next owner
my $x =  $ticket_id % $totmembers;
my $owner = $owners[$x];

## Some debug option when uncommented
## $RT::Logger->info("AUTOASSIGN: DEBUG ". $self->TicketObj->id ." to user
". $owner );
## $RT::Logger->info("AUTOASSIGN: DEBUG Total number of owners ".
scalar(@owners) );
## uncomment this if you want to run in dry run mode
## return 1;

# set the owner
$RT::Logger->info("AUTOASSIGN: ". $self->TicketObj->id ." to user ". $owner
);
my ($status, $msg) = $self->TicketObj->SetOwner( $owner );
unless( $status ) {
$RT::Logger->error( "Impossible to assign the ticket to $owner: $msg" );
return undef;
}

return 1;



> --
> Asif Iqbal
> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
>
>


-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


Re: [rt-users] Ticket Links missing post upgrade/conversion to Oracle 4.2.11.

2015-10-22 Thread Aaron Guise
Hi Greg,

This certainly sounds like a mismatch as Maik suggested.   This happens
when I refresh my test/dev instance of RT from production also.

I then run the rt-validator over the database and this corrects all the
mismatched links.  This is needed as I use the server hostname as the
Organization and this does differ between environments.

I simply import the database and then execute /opt/rt4/sbin/rt-validator
--check --resolve --force

Once that is completed all ticket links are working again.

*Regards,*

*Aaron Guise*




*   07 850 3231 027 704 5306 aa...@guise.net.nz   *
  


On Wed, Oct 14, 2015 at 3:23 AM, Hummer, Greg  wrote:

> Good morning, Maik.
>
> My technical team checked our production RT and found the $organization
> variable. It appeared to be correct, however, they were unsure what you
> meant when you said (*It must fit to the values of field "base" and
> "target" in table "links"*)*.*
>
>
>
> Can you provide more directions on what you meant? The more specific you
> can be, the better it would be for my non-Request Tracker DBA's.
>
>
>
> Some additional information: we have a stage server that is currently
> running the same version of request tracker (4.2.11 Oracle). It is a copy
> of our production database from a few months ago. It is showing the ticket
> links and has the same $Organization variable as the production account.
>
>
>
> Thanks for the help!
>
> Greg
>
> 
> From: rt-users [rt-users-boun...@lists.bestpractical.com] on behalf of
> Maik Nergert [maik.nerg...@uni-hamburg.de]
> Sent: Friday, October 09, 2015 2:12 AM
> To: rt-users@lists.bestpractical.com
> Subject: Re: [rt-users] Ticket Links missing post upgrade/conversion to
> Oracle 4.2.11.
>
> Hey Greg,
>
> please check if your $Organization variable is set in RT_SiteConfig.pm
> It must fit to the values of field "base" and "target" in table "links"
>
> If your code snipped is correct then
> Set( $Organization, 'example.com' );
>
>
> best
> Maik
>
>


Re: [rt-users] round-robin auto assignment?

2015-10-22 Thread Asif Iqbal
On Fri, Apr 12, 2013 at 2:22 PM, Thomas Sibley 
wrote:

> On 04/12/2013 11:06 AM, Doug Eubanks wrote:
> > I apologize, but Perl isn't my strong suit.  :D
> >
> > Changing those three lines still compiles and updates the scrip, but it
> > doesn't do anything and never assigns the ticket to anyone now.
>
> Oh, I see, the previous code was trying to set the owner as the next
> user in the array (but may have set an undef owner if the current owner
> was the last one in the array).
>
> I think you'll need to update the code to set $new_owner to the next
> owner instead of a random one.  I haven't fully read the scrip though,
> so there may be an underlying more fundamental problem.
>


I were able to get it working with modulo. Here is the complete scrip we
are running since today and so far looks good. Any suggestion is welcome to
improve it.

I used modulo to pick the next owner. Besides that rest of the code is from
http://requesttracker.wikia.com/wiki/AutoSetOwner

Description: Auto assign ticket on create
Condition: On Create
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

Custom condition: return 1;
Custom action preparation code: return 1;
Custom action cleanup code:
# get out if ticket has a owner
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;

# gather the list of owners
my @owners = qw(
foo
bar
qaz
);

push(@owners, @owners);

# get a count for the owners
my $totmembers = scalar( @owners );

# get this ticket id
my $ticket_id = $self->TicketObj->id;

# ticket_id modulo totmembers to pick the next owner
my $x =  $ticket_id % $totmembers;
my $owner = $owners[$x];

# set the owner
$RT::Logger->info("Auto assign ticket ". $self->TicketObj->id ." to user ".
$owner );
my ($status, $msg) = $self->TicketObj->SetOwner( $owner );
unless( $status ) {
$RT::Logger->error( "Impossible to assign the ticket to $owner: $msg" );
return undef;
}
return 1;


-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


Re: [rt-users] Installing GD components

2015-10-22 Thread Asanka Gunasekera
Hi Kobus, how do I enable detailed loggin, below is what I did but it still 
gives only succesfull logins

Set($LogToSyslog, '');
Set($LogToFile, 'debug');
Set($LogDir, '/var/log/rt');
Set($LogToFileNamed , "rt.log");


Thanks and Regards

Asanka


On Tue, 20/10/15, Asanka Gunasekera  wrote:

 Subject: Re: [rt-users] Installing GD components
 To: "Kobus Bensch" 
 Date: Tuesday, 20 October, 2015, 17:38
 
 I dont see any errors or warnings
 Kobus, any how let me increas the loging level and see. 
 
 Thanks and best Reagrds
 
 Asanka
 
 Hope you dont mind if I to update if needed help on this
 
 
 On Tue, 20/10/15, Kobus Bensch 
 wrote:
 
  Subject: Re: [rt-users] Installing GD components
  To: "Asanka Gunasekera" 
  Date: Tuesday, 20 October, 2015, 17:27
  
  
      Not sure about the close_wait. That
 has to be
  serverside. Whats in
      your logs?
  
      
  
      On 20/10/2015 12:06,
  Asanka Gunasekera
        wrote:
  
      
      
        Hi Kobus, thank you for the
 reply, understood :).
  Any idea about the open sockets having status close_wait
  (meaning server side is holding the socket open when the
  client has already send a close)
  
  Thanks and Regards
  
  Asanka
  
  On Tue, 20/10/15, Kobus Bensch 
  wrote:
  
   Subject: Re: [rt-users] Installing GD components
   To: "Asanka Gunasekera" 
   Date: Tuesday, 20 October, 2015, 16:51
   
   
       The GD stuff is used for graph creation
 and displays.
  So
   if you not
       fussed then thats fine.
   
       
   
       As for the queues. My understanding is
 that each queu
   need its own
       set of email addresses as that is how
 it gets into that
   queue unless
       you move tickets to that queue
 manually, but all
   correspondence will
       go into the first queue found that the
 email address is
   attached to.
       Usually your default queue.
   
       
   
       Kobus
   
       
   
       On 20/10/2015 11:48,
   Asanka Gunasekera
         wrote:
   
       
       
         Hi Kobus, with below update I
 was able to get
   things install but I am not suer what would be the
 impact
  on
   RT of skipping DG test. Any how now I can log in and
 all
  but
   faced with below obstetrical
   
   1. I can log in and all, but after a while I am
 seeing
   CLOSE_WAIT socket is created for each selection that
 I make
  
   on the dashboard. Eventually the system goes
 unresponsive.
   
   root@iplrt logs]# netstat
 -nalp | grep -i wait
   tcp        1     
 0 192.168.11.254:80          
   192.168.11.118:57076       
 CLOSE_WAIT  3176/httpd     
    
  
   tcp        1     
 0 192.168.11.254:80          
   192.168.11.118:57083       
 CLOSE_WAIT  3177/httpd     
    
  
   tcp        1     
 0 192.168.11.254:80          
   192.168.11.118:57082       
 CLOSE_WAIT  3185/httpd     
    
  
   tcp        1     
 0 192.168.11.254:80          
   192.168.11.118:57084       
 CLOSE_WAIT  3365/httpd     
    
  
   [root@iplrt logs]# 
   
   2. Do I need to have separate mail accounts for each
 queue
   that I make. Lets say I have 10 queues and the way I
 can
  see
   with fetch mail you have to have 10 emails address
 minimum.
   Is there a way to use just 2 address for all queues
 one for
   correspondence and one for communications
   
   Thanks and Regards
   
   Asanka
   
   On Tue, 20/10/15, Asanka Gunasekera 
   wrote:
   
    Subject: Re: [rt-users] Installing GD
 components
    To: "Kobus Bensch" 
    Date: Tuesday, 20 October, 2015, 10:34
    
    Hi Kobus, I tried
    installing it manually (GD) but when I ran
 ./Build test it
    was failing one test
    
    Failed
    test 'image comparison test 7'
    
    since in GD readme it said this is
 optional I
    just went and install and now I can do mak
 on RT, what
   would
    be the ill effect doing above and what is
 the function to
    RT
    
    Thanks and Regards
    
    Asanka
    
    
    On Tue, 20/10/15, Asanka Gunasekera 
    wrote:
    
     Subject: Re: [rt-users]
    Installing GD components
     To: "Kobus
    Bensch" 
     Date: Tuesday, 20 October, 2015, 10:03
     
     Hi Kobus, please find
     below the out put of the command
     
     root@iplrt ~]# yum list
     installed | grep gd
    
    eggdbus.x86_64     
         0.6-3.el6 
 
    
   @anaconda-CentOS-201508042137.x86_64/6.7
     gd.x86_64           
    
   2.0.35-11.el6   @base       
  
                              
     gd-devel.x86_64    

[rt-users] Overflow bug when using external auth plugin with assets

2015-10-22 Thread fleon
Hello, i have rt 4.2.10 with both external auth plugin and assets plugin.
When looking at an asset, the owner's name and email appears, and it's too
wide for the rest of the label "User Summary".

Screenshot of the issue at http://i.imgur.com/vf1Cy2d.png localized in
spanish.



--
View this message in context: 
http://requesttracker.8502.n7.nabble.com/Overflow-bug-when-using-external-auth-plugin-with-assets-tp60804.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.