Scrip read value of CustomField assigned to Group


#1

I have one CustomField assigned to user group.
How to get its value in scrip?
Scrip will be executed on correspondence.


#2

You should load the group:

my $Group = RT::Group->new( $self->CurrentUser );
$Group->LoadUserDefinedGroup('MYGROUP');

then get the CF value:

my $cf_value = $Group->FirstCustomFieldValue('FIELD_NAME');

#3

Thank you very much for fast and helpful answer!


#4

You’re welcome :slight_smile: When you search for such method (here: FirstCustomFieldValue), don’t miss that most RT objects (Groups, Tickets, …) are derived from RT::Record and methods available in lib/RT/Record.pm are available for those objects.