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

2015-10-23 Thread Asif Iqbal
On Fri, Oct 23, 2015 at 2:28 AM, Christian Loos  wrote:

> Am 22.10.2015 um 22:21 schrieb Asif Iqbal:
> > # 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;
>
> I think a better solution for the owners list would be to create a group
> in RT, assign the needed users to the group and then load the possible
> owner from that group. With this, you can change the owners list from
> the RT Webinterface.
>
> Script code would be something like this:
>
> my @owners;
> my $users = RT::Users->new(RT->SystemUser);
> $users->MemberOfGroup();
> while( my $user = $users->Next ) {
> push @owners, $user->Name;
> }
>
>
I agree, this is cleaner. Although, I picked the external file since I am
looking
for a way to update that with users who are not in vacation.



>
> Chris
>



-- 
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] round-robin auto assignment?

2015-10-23 Thread Christian Loos
Am 22.10.2015 um 22:21 schrieb Asif Iqbal:
> # 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;

I think a better solution for the owners list would be to create a group
in RT, assign the needed users to the group and then load the possible
owner from that group. With this, you can change the owners list from
the RT Webinterface.

Script code would be something like this:

my @owners;
my $users = RT::Users->new(RT->SystemUser);
$users->MemberOfGroup();
while( my $user = $users->Next ) {
push @owners, $user->Name;
}


Chris