Defining custom attributes

I am trying to define a custom attribute for queues, but I can’t find
what I’m doing wrong, maybe some of you can help me.

Here’s my code:

my $at = RT::Attributes->NewItem($session{‘CurrentUser’});
$at->Create(ObjectType => “RT::Queue”, ObjectId => $QueueObj->Id, Name
=> “Etc”, Description => “Etc”, Content => “Etc”);

The requests fail with “Can’t use string (“RT::Attributes”) as a HASH
ref while “strict refs” in use”.

Thank you for your time.

Regards,
Carlos Silva

Too complex. Try: $QueueObj->AddAttribute( Name=> “Etc”, Description =>
“Etc”, Content => “Etc”);

See RT::Record for more.On Tue, Apr 1, 2008 at 5:53 AM, Carlos Silva cmsilva@mobicomp.com wrote:

I am trying to define a custom attribute for queues, but I can’t find
what I’m doing wrong, maybe some of you can help me.

Here’s my code:

my $at = RT::Attributes->NewItem($session{‘CurrentUser’});
$at->Create(ObjectType => “RT::Queue”, ObjectId => $QueueObj->Id, Name
=> “Etc”, Description => “Etc”, Content => “Etc”);

The requests fail with “Can’t use string (“RT::Attributes”) as a HASH
ref while “strict refs” in use”.

Thank you for your time.

Regards,
Carlos Silva


The rt-users Archives

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

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