External CustomFieldValues : Users from certain groups

Hi List,

I try to have only the users from certain groups in a custom field.
My code doesn’t work. I need your help.
Removing the “WhoBelongToGroups” is OK, no error ans all users are available.

RT version : 4.2.0

Thanks in advances.
Horst

local/lib/RT/CustomFieldValues/ADIUsers.pm
package RT::CustomFieldValues::ADIUsers;

use strict;
use warnings;

use base qw(RT::CustomFieldValues::External);

sub SourceDescription {
return ‘RT LoRo ADI users’;
}

sub ExternalValues {
my $self = shift;

my @res;
my $i = 0;
my $users = RT::Users->new( $self->CurrentUser );
$users->LimitToPrivileged;
$users->WhoBelongToGroups{ Groups => {40}, IncludeSubgroupMembers => 0 };
$users->LimitToEnabled;

while( my $user = $users->Next ) {
    push @res, {
        name        => $user->Name.' ('.$user->RealName.')',
        description => $user->RealName,
        sortorder   => $i++,
    };
}
return \@res;

}

RT::Base->_ImportOverlays();

1;

error log contains :
[17114] [Thu May 1 11:56:08 2014] [error]: syntax error at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 99, near "->WhoBelongToGroups{ "
Global symbol “$users” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 101.
Global symbol “$users” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 104.
Global symbol “@res” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 105.
Global symbol “$i” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 108.
Global symbol “@res” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 111.
syntax error at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 112, near "}"
Compilation failed in require at (eval 791) line 2.

Stack:
[(eval 791):2]
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]
[/opt/rt4/share/html/Elements/EditCustomField:99]
[/opt/rt4/share/html/Elements/EditCustomFields:65]
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]
[/opt/rt4/share/html/Widgets/TitleBox:56]
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]
[/opt/rt4/share/html/Ticket/Modify.html:66]
[/opt/rt4/share/html/Ticket/autohandler:66]
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:680]
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:368]
[/opt/rt4/local/html/autohandler:55]

Stack:
[/opt/rt4/sbin/…/lib/RT/CustomField.pm:489]
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]
[/opt/rt4/share/html/Elements/EditCustomField:99]
[/opt/rt4/share/html/Elements/EditCustomFields:65]
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]
[/opt/rt4/share/html/Widgets/TitleBox:56]
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]
[/opt/rt4/share/html/Ticket/Modify.html:66]
[/opt/rt4/share/html/Ticket/autohandler:66]
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:680]
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:368]
[/opt/rt4/local/html/autohandler:55] (/opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm:211)
Trace begun at /opt/rt4/sbin/…/lib/RT.pm line 295
Log::Dispatch::ANON(‘Log::Dispatch=HASH(0x7fa4358d1470)’, ‘syntax error at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 99, near "->WhoBelongToGroups{ "^JGlobal symbol “$users” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 101.^JGlobal symbol “$users” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 104.^JGlobal symbol “@res” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 105.^JGlobal symbol “$i” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 108.^JGlobal symbol “@res” requires explicit package name at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 111.^Jsyntax error at /opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 112, near “}”^JCompilation failed in require at (eval 791) line 2.^J^JStack:^J [(eval 791):2]^J [/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]^J [/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]^J [/opt/rt4/share/html/Elements/EditCustomField:99]^J [/opt/rt4/share/html/Elements/EditCustomFields:65]^J [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]^J [/opt/rt4/share/html/Widgets/TitleBox:56]^J [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]^J [/opt/rt4/share/html/Ticket/Modify.html:66]^J [/opt/rt4/share/html/Ticket/autohandler:66]^J [/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:680]^J [/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:368]^J [/opt/rt4/local/html/autohandler:55]^J^JStack:^J [/opt/rt4/sbin/…/lib/RT/CustomField.pm:489]^J [/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]^J [/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]^J [/opt/rt4/share/html/Elements/EditCustomField:99]^J [/opt/rt4/share/html/Elements/EditCustomFields:65]^J [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]^J [/opt/rt4/share/html/Widgets/TitleBox:56]^J [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]^J [/opt/rt4/share/html/Ticket/Modify.html:66]^J [/opt/rt4/share/html/Ticket/autohandler:66]^J [/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:680]^J [/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:368]^J [/opt/rt4/local/html/autohandler:55]^J’) called at /opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm line 211
HTML::Mason::Exception::as_rt_error(‘HTML::Mason::Exception=HASH(0x7fa43a4693e8)’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Exceptions.pm line 282
HTML::Mason::Exception::as_string(‘HTML::Mason::Exception=HASH(0x7fa43a4693e8)’, undef, ‘’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Request.pm line 570
HTML::Mason::Request::_handle_error(‘RT::Interface::Web::Request=HASH(0x7fa439c93e18)’, ‘HTML::Mason::Exception=HASH(0x7fa43a4693e8)’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Request.pm line 521
HTML::Mason::Request::exec(‘RT::Interface::Web::Request=HASH(0x7fa439c93e18)’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm line 96
eval {…} at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm line 96
HTML::Mason::Request::PSGI::exec(‘RT::Interface::Web::Request=HASH(0x7fa439c93e18)’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Interp.pm line 345
HTML::Mason::Interp::exec(undef, undef, ‘id’, 71439) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm line 59
eval {…} at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm line 59
HTML::Mason::PSGIHandler::invoke_mason(‘HTML::Mason::PSGIHandler::Streamy=HASH(0x7fa439c944d8)’, ‘HASH(0x7fa439710878)’, ‘HASH(0x7fa433513760)’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler/Streamy.pm line 52
HTML::Mason::PSGIHandler::Streamy::ANON(‘CODE(0x7fa439f15778)’) called at /opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm line 307
RT::Interface::Web::Handler::ANON(‘CODE(0x7fa439f15778)’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Util.pm line 301
Plack::Util::ANON(‘CODE(0x7fa439e88fe0)’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Handler/Apache2.pm line 89
Plack::Handler::Apache2::call_app(‘Plack::Handler::Apache2’, ‘Apache2::RequestRec=SCALAR(0x7fa431f70f50)’, ‘CODE(0x7fa439e2b0f8)’) called at /opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Handler/Apache2.pm line 126
Plack::Handler::Apache2::handler(‘Apache2::RequestRec=SCALAR(0x7fa431f70f50)’) called at -e line 0
eval {…} at -e line 0

Note Importante: Le contenu de ce courriel est uniquement réservé à la personne ou l’organisme à qui il est destiné. Si vous n’êtes pas le destinataire prévu, veuillez nous en informer au plus vite et détruire le présent courriel. Dans ce cas, il ne vous est pas permis de copier ce courriel, de le distribuer ou de l’utiliser de quelque manière que ce soit.

Important Notice: The content of this e-mail is intended only and solely for the use of the named recipient or organization. If you are not the named recipient, please inform us immediately and delete the present e-mail. In this case, you are not allowed to copy, distribute or use this e-mail in any way.

I try to have only the users from certain groups in a custom field.
My code doesn’t work. I need your help.
Removing the “WhoBelongToGroups” is OK, no error ans all users are available.

   $users->WhoBelongToGroups{ Groups => {40}, IncludeSubgroupMembers => 0 };

You have two errors

Methods in perl are called with () not {}
The Groups argument takes an arrayref not a hashref

    $users->WhoBelongToGroups( Groups => [40], IncludeSubgroupMembers => 0 _;

-kevin

Thank you very much :slight_smile:

Horst

-----Message d’origine-----
De : rt-users [mailto:rt-users-bounces@lists.bestpractical.com] De la part de
Kevin Falcone
Envoyé : jeudi 1 mai 2014 19:11
À : rt-users@lists.bestpractical.com
Objet : Re: [rt-users] External CustomFieldValues : Users from certain groups

I try to have only the users from certain groups in a custom field.
My code doesn’t work. I need your help.
Removing the “WhoBelongToGroups” is OK, no error ans all users are
available.

   $users->WhoBelongToGroups{ Groups => {40},

IncludeSubgroupMembers => 0 };

You have two errors

Methods in perl are called with () not {} The Groups argument takes an
arrayref not a hashref

    $users->WhoBelongToGroups( Groups => [40],

IncludeSubgroupMembers => 0 _;

-kevin

error log contains :


[17114] [Thu May 1 11:56:08 2014] [error]: syntax error at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 99,
near
"->WhoBelongToGroups{ "

Global symbol “$users” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 101.

Global symbol “$users” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 104.

Global symbol “@res” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 105.

Global symbol “$i” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 108.

Global symbol “@res” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 111.

syntax error at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 112, near
“}”

Compilation failed in require at (eval 791) line 2.

Stack:

 [(eval 791):2]

 [/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]

 [/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]

 [/opt/rt4/share/html/Elements/EditCustomField:99]

 [/opt/rt4/share/html/Elements/EditCustomFields:65]

 [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]

 [/opt/rt4/share/html/Widgets/TitleBox:56]

 [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]

 [/opt/rt4/share/html/Ticket/Modify.html:66]

 [/opt/rt4/share/html/Ticket/autohandler:66]

 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:680]

 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:368]

 [/opt/rt4/local/html/autohandler:55]

Stack:

 [/opt/rt4/sbin/../lib/RT/CustomField.pm:489]

 [/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]

 [/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]

 [/opt/rt4/share/html/Elements/EditCustomField:99]

 [/opt/rt4/share/html/Elements/EditCustomFields:65]

 [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]

 [/opt/rt4/share/html/Widgets/TitleBox:56]

 [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]

 [/opt/rt4/share/html/Ticket/Modify.html:66]

 [/opt/rt4/share/html/Ticket/autohandler:66]

 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:680]

 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:368]

 [/opt/rt4/local/html/autohandler:55]

(/opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm:211)

Trace begun at /opt/rt4/sbin/…/lib/RT.pm line 295

Log::Dispatch::ANON(‘Log::Dispatch=HASH(0x7fa4358d1470)’,
‘syntax error at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 99,
near
"->WhoBelongToGroups{ "^JGlobal symbol “$users” requires explicit
package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line
101.^JGlobal symbol “$users”
requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm
line 104.^JGlobal symbol “@res” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line
105.^JGlobal symbol “$i”
requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm
line 108.^JGlobal symbol “@res” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line
111.^Jsyntax error at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 112,
near “}”^JCompilation
failed in require at (eval 791) line 2.^J^JStack:^J [(eval 791):2]^J
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]^J
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]^J
[/opt/rt4/share/html/Elements/EditCustomField:99]^J
[/opt/rt4/share/html/Elements/EditCustomFields:65]^J
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]^J
[/opt/rt4/share/html/Widgets/TitleBox:56]^J
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]^J
[/opt/rt4/share/html/Ticket/Modify.html:66]^J
[/opt/rt4/share/html/Ticket/autohandler:66]^J
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:680]^J
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:368]^J
[/opt/rt4/local/html/autohandler:55]^J^JStack:^J
[/opt/rt4/sbin/…/lib/RT/CustomField.pm:489]^J
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]^J
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]^J
[/opt/rt4/share/html/Elements/EditCustomField:99]^J
[/opt/rt4/share/html/Elements/EditCustomFields:65]^J
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]^J
[/opt/rt4/share/html/Widgets/TitleBox:56]^J
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]^J
[/opt/rt4/share/html/Ticket/Modify.html:66]^J
[/opt/rt4/share/html/Ticket/autohandler:66]^J
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:680]^J
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:368]^J
[/opt/rt4/local/html/autohandler:55]^J’)
called at /opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm line 211

HTML::Mason::Exception::as_rt_error(‘HTML::Mason::Exception=HASH(0x7f
a43a4693e8)’) called at

/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Exceptions.pm line
282

HTML::Mason::Exception::as_string(‘HTML::Mason::Exception=HASH(0x7fa4
3a4693e8)’, undef, ‘’)

called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Request.pm line 570

HTML::Mason::Request::_handle_error(‘RT::Interface::Web::Request=HASH
(0x7fa439c93e18)’,

‘HTML::Mason::Exception=HASH(0x7fa43a4693e8)’) called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Request.pm line
521

HTML::Mason::Request::exec(‘RT::Interface::Web::Request=HASH(0x7fa439
c93e18)’) called at

/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm
line 96

eval {…} at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm line
96

HTML::Mason::Request::PSGI::exec(‘RT::Interface::Web::Request=HASH(0x7
fa439c93e18)’) called at

/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Interp.pm line 345

HTML::Mason::Interp::exec(undef, undef, ‘id’, 71439) called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm
line 59

eval {…} at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm line
59

HTML::Mason::PSGIHandler::invoke_mason(‘HTML::Mason::PSGIHandler::St
reamy=HASH(0x7fa439c944d8)’,

‘HASH(0x7fa439710878)’, ‘HASH(0x7fa433513760)’) called at

/opt/perl-
5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler/Streamy.p
m line 52

HTML::Mason::PSGIHandler::Streamy::ANON(‘CODE(0x7fa439f15778)’)
called at

/opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm line 307

RT::Interface::Web::Handler::ANON(‘CODE(0x7fa439f15778)’) called
at
/opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Util.pm line 301

Plack::Util::ANON(‘CODE(0x7fa439e88fe0)’) called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Handler/Apache2.pm line
89

Plack::Handler::Apache2::call_app(‘Plack::Handler::Apache2’,
‘Apache2::RequestRec=SCALAR(0x7fa431f70f50)’,
‘CODE(0x7fa439e2b0f8)’) called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Handler/Apache2.pm line
126

Plack::Handler::Apache2::handler(‘Apache2::RequestRec=SCALAR(0x7fa431f
70f50)’) called at -e

line 0

eval {…} at -e line 0



Note Importante: Le contenu de ce courriel est uniquement reserve la
personne ou l’organisme
qui il est destine. Si vous n’etes pas le destinataire prevu, veuillez nous
en informer au
plus vite et detruire le present courriel. Dans ce cas, il ne vous est pas
permis de copier ce
courriel, de le distribuer ou de l’utiliser de quelque maniere que ce soit.



Important Notice: The content of this e-mail is intended only and solely
for the use of the
named recipient or organization. If you are not the named recipient,
please inform us
immediately and delete the present e-mail. In this case, you are not
allowed to copy,
distribute or use this e-mail in any way.




RT Training - Dallas May 20-21
http://bestpractical.com/training

Note Importante: Le contenu de ce courriel est uniquement réservé à la personne ou l’organisme à qui il est destiné. Si vous n’êtes pas le destinataire prévu, veuillez nous en informer au plus vite et détruire le présent courriel. Dans ce cas, il ne vous est pas permis de copier ce courriel, de le distribuer ou de l’utiliser de quelque manière que ce soit.

Important Notice: The content of this e-mail is intended only and solely for the use of the named recipient or organization. If you are not the named recipient, please inform us immediately and delete the present e-mail. In this case, you are not allowed to copy, distribute or use this e-mail in any way.

Hello,

It’s possible to filter over more than one group ?

$users->WhoBelongToGroups( Groups => [40] …

Thanks
Horst

-----Message d’origine-----
De : rt-users [mailto:rt-users-bounces@lists.bestpractical.com] De la part de
Kevin Falcone
Envoyé : jeudi 1 mai 2014 19:11
À : rt-users@lists.bestpractical.com
Objet : Re: [rt-users] External CustomFieldValues : Users from certain groups

I try to have only the users from certain groups in a custom field.
My code doesn’t work. I need your help.
Removing the “WhoBelongToGroups” is OK, no error ans all users are
available.

   $users->WhoBelongToGroups{ Groups => {40},

IncludeSubgroupMembers => 0 };

You have two errors

Methods in perl are called with () not {} The Groups argument takes an
arrayref not a hashref

    $users->WhoBelongToGroups( Groups => [40],

IncludeSubgroupMembers => 0 _;

-kevin

error log contains :


[17114] [Thu May 1 11:56:08 2014] [error]: syntax error at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 99,
near
"->WhoBelongToGroups{ "

Global symbol “$users” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 101.

Global symbol “$users” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 104.

Global symbol “@res” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 105.

Global symbol “$i” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 108.

Global symbol “@res” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 111.

syntax error at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 112, near
“}”

Compilation failed in require at (eval 791) line 2.

Stack:

 [(eval 791):2]

 [/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]

 [/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]

 [/opt/rt4/share/html/Elements/EditCustomField:99]

 [/opt/rt4/share/html/Elements/EditCustomFields:65]

 [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]

 [/opt/rt4/share/html/Widgets/TitleBox:56]

 [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]

 [/opt/rt4/share/html/Ticket/Modify.html:66]

 [/opt/rt4/share/html/Ticket/autohandler:66]

 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:680]

 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:368]

 [/opt/rt4/local/html/autohandler:55]

Stack:

 [/opt/rt4/sbin/../lib/RT/CustomField.pm:489]

 [/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]

 [/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]

 [/opt/rt4/share/html/Elements/EditCustomField:99]

 [/opt/rt4/share/html/Elements/EditCustomFields:65]

 [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]

 [/opt/rt4/share/html/Widgets/TitleBox:56]

 [/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]

 [/opt/rt4/share/html/Ticket/Modify.html:66]

 [/opt/rt4/share/html/Ticket/autohandler:66]

 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:680]

 [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:368]

 [/opt/rt4/local/html/autohandler:55]

(/opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm:211)

Trace begun at /opt/rt4/sbin/…/lib/RT.pm line 295

Log::Dispatch::ANON(‘Log::Dispatch=HASH(0x7fa4358d1470)’,
‘syntax error at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 99,
near
"->WhoBelongToGroups{ "^JGlobal symbol “$users” requires explicit
package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line
101.^JGlobal symbol “$users”
requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm
line 104.^JGlobal symbol “@res” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line
105.^JGlobal symbol “$i”
requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm
line 108.^JGlobal symbol “@res” requires explicit package name at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line
111.^Jsyntax error at
/opt/rt4/sbin/…/local/lib/RT/CustomFieldValues/ADIUsers.pm line 112,
near “}”^JCompilation
failed in require at (eval 791) line 2.^J^JStack:^J [(eval 791):2]^J
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]^J
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]^J
[/opt/rt4/share/html/Elements/EditCustomField:99]^J
[/opt/rt4/share/html/Elements/EditCustomFields:65]^J
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]^J
[/opt/rt4/share/html/Widgets/TitleBox:56]^J
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]^J
[/opt/rt4/share/html/Ticket/Modify.html:66]^J
[/opt/rt4/share/html/Ticket/autohandler:66]^J
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:680]^J
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:368]^J
[/opt/rt4/local/html/autohandler:55]^J^JStack:^J
[/opt/rt4/sbin/…/lib/RT/CustomField.pm:489]^J
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:161]^J
[/opt/rt4/local/html/Elements/EditCustomFieldSelect:54]^J
[/opt/rt4/share/html/Elements/EditCustomField:99]^J
[/opt/rt4/share/html/Elements/EditCustomFields:65]^J
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:56]^J
[/opt/rt4/share/html/Widgets/TitleBox:56]^J
[/opt/rt4/share/html/Elements/EditCustomFieldCustomGroupings:57]^J
[/opt/rt4/share/html/Ticket/Modify.html:66]^J
[/opt/rt4/share/html/Ticket/autohandler:66]^J
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:680]^J
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:368]^J
[/opt/rt4/local/html/autohandler:55]^J’)
called at /opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm line 211

HTML::Mason::Exception::as_rt_error(‘HTML::Mason::Exception=HASH(0x7f
a43a4693e8)’) called at

/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Exceptions.pm line
282

HTML::Mason::Exception::as_string(‘HTML::Mason::Exception=HASH(0x7fa4
3a4693e8)’, undef, ‘’)

called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Request.pm line 570

HTML::Mason::Request::_handle_error(‘RT::Interface::Web::Request=HASH
(0x7fa439c93e18)’,

‘HTML::Mason::Exception=HASH(0x7fa43a4693e8)’) called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Request.pm line
521

HTML::Mason::Request::exec(‘RT::Interface::Web::Request=HASH(0x7fa439
c93e18)’) called at

/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm
line 96

eval {…} at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm line
96

HTML::Mason::Request::PSGI::exec(‘RT::Interface::Web::Request=HASH(0x7
fa439c93e18)’) called at

/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/Interp.pm line 345

HTML::Mason::Interp::exec(undef, undef, ‘id’, 71439) called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm
line 59

eval {…} at
/opt/perl-5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler.pm line
59

HTML::Mason::PSGIHandler::invoke_mason(‘HTML::Mason::PSGIHandler::St
reamy=HASH(0x7fa439c944d8)’,

‘HASH(0x7fa439710878)’, ‘HASH(0x7fa433513760)’) called at

/opt/perl-
5.18.1/lib/site_perl/5.18.1/HTML/Mason/PSGIHandler/Streamy.p
m line 52

HTML::Mason::PSGIHandler::Streamy::ANON(‘CODE(0x7fa439f15778)’)
called at

/opt/rt4/sbin/…/lib/RT/Interface/Web/Handler.pm line 307

RT::Interface::Web::Handler::ANON(‘CODE(0x7fa439f15778)’) called
at
/opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Util.pm line 301

Plack::Util::ANON(‘CODE(0x7fa439e88fe0)’) called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Handler/Apache2.pm line
89

Plack::Handler::Apache2::call_app(‘Plack::Handler::Apache2’,
‘Apache2::RequestRec=SCALAR(0x7fa431f70f50)’,
‘CODE(0x7fa439e2b0f8)’) called at
/opt/perl-5.18.1/lib/site_perl/5.18.1/Plack/Handler/Apache2.pm line
126

Plack::Handler::Apache2::handler(‘Apache2::RequestRec=SCALAR(0x7fa431f
70f50)’) called at -e

line 0

eval {…} at -e line 0



Note Importante: Le contenu de ce courriel est uniquement reserve la
personne ou l’organisme
qui il est destine. Si vous n’etes pas le destinataire prevu, veuillez nous
en informer au
plus vite et detruire le present courriel. Dans ce cas, il ne vous est pas
permis de copier ce
courriel, de le distribuer ou de l’utiliser de quelque maniere que ce soit.



Important Notice: The content of this e-mail is intended only and solely
for the use of the
named recipient or organization. If you are not the named recipient,
please inform us
immediately and delete the present e-mail. In this case, you are not
allowed to copy,
distribute or use this e-mail in any way.




RT Training - Dallas May 20-21
http://bestpractical.com/training

Note Importante: Le contenu de ce courriel est uniquement réservé à la personne ou l’organisme à qui il est destiné. Si vous n’êtes pas le destinataire prévu, veuillez nous en informer au plus vite et détruire le présent courriel. Dans ce cas, il ne vous est pas permis de copier ce courriel, de le distribuer ou de l’utiliser de quelque manière que ce soit.

Important Notice: The content of this e-mail is intended only and solely for the use of the named recipient or organization. If you are not the named recipient, please inform us immediately and delete the present e-mail. In this case, you are not allowed to copy, distribute or use this e-mail in any way.

It’s possible to filter over more than one group ?

$users->WhoBelongToGroups( Groups => [40] …

Yes - from the docs (which are improved in 4.2.4rc1 because of a user
contribution)

It also wouldn’t make a lot of sense to take an arrayref as an
argument, but only use one value in the arrayref.

-kevin