[rt-users] I just can't figure out how to get the values from mycustom fields!

Joe Casadonte joe.casadonte at oracle.com
Mon Mar 5 10:09:46 EST 2007


On 3/5/2007 3:08 AM, Brian Kjelin Olsen wrote:

> I just can't figure how to get the values of custom fields on ticket transactions from scrip.

Here's what I've done in a Condition's IsApplicable() sub:

	my($CFNAME) = 'Severity';

	my($q) = $self->TicketObj->QueueObj;
	my($cf) = new RT::CustomField $q->CurrentUser;

	$cf->LoadByNameAndQueue(Name => $CFNAME, Queue => $q->id);
	$cf->LoadByNameAndQueue(Name => $CFNAME, Queue => 0) unless $cf->id;
	unless ($cf->id) {
		$RT::Logger->warning("Custom field '$CFNAME' isn't global or defined 
for queue '" . $q->Name . "'");
		return undef;
	}

	return ! $self->TicketObj->FirstCustomFieldValue($cf->id);

Hope that helps!

-- 
Regards,


joe

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|           Joe Casadonte           |  joe.casadonte at oracle.com     |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| Oracle Transportation Management  |  1016 West Ninth Avenue       |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  Suite 300                    |
|           610-491-3315            |  King of Prussia, PA  19406   |
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





More information about the rt-users mailing list