Re: [rt-users] How to get Custom Field's description which setted by ExternalValues subroutine

2013-10-08 Thread Parish, Brent
Hi.

I'm writing a scrip.
In that scrip, I have no trouble getting the value of a custom field that the 
user set.
I get the value with:  $CF_Value = $self-TicketObj-FirstCustomFieldValue( 
'Colors' );

But I don't know how to get the content from the Description value for that 
same field?
To be clear:  I want the description associated with the VALUE set in that 
CustomField, NOT the Description of the CustomField itself.

In other words, if MyCustomFieldName is a Select One Value type of 
CustomField, and some of the values look like this:

Name = red Description = Red is a lovely color
Name = blueDescription = Blue is nice too

Inside the scrip I want to read that Description field.  E.g. I need to set a 
variable to Blue is nice too, if the user has selected blue for the 
customfield called 'Colors'.

Many thanks!
Brent



Ruslan 
Zakirovhttp://www.mail-archive.com/search?l=rt-users@lists.bestpractical.comq=from:%22Ruslan+Zakirov%22
 Wed, 22 May 2013 03:45:32 
-0700http://www.mail-archive.com/search?l=rt-users@lists.bestpractical.comq=date:20130522

Hi,



This is description of a value that is not stored along with value on the

ticket or other object value is set on. The only way is to get list of

values, find one that was set on the object and get description. External

Custom Field Values are very sensitive to methods called on collection or

record, so you have to be careful.




chrilde at gmailMay 21, 2013, 5:54 AM


Hi All,

I've got a problem with the Custom Field description issue. I created a
custom field named Contact, and when a new ticket is created, I use scrip
to add this Contact user to Requestor list.
I remember that when we set the ExternalValues with code below, we would
pass a description to RT
sub ExternalValues {
..
..
push @res, {
name = $element-{'cont_name'},
description = $element-{'cont_email'},
sortorder = $i++,
};
..
}

So i want to use this description value to create user or add to mail
list. Can anyone tell me how to get it?

I used code as listed below, but what i got is just the Description value
of this Custom Field, NOT the description of the custom field value I
passed in config file.

my $CF = new RT::CustomField($RT::SystemUser);
$CF-LoadByName( Queue = $ticket-QueueObj-id, Name = $CFName );
$Email = $CF-Description();

Any suggestions would be help, thanks a lot.

-- 
RT Training in New York, October 8th and 9th: http://bestpractical.com/training

Re: [rt-users] How to get Custom Field's description which setted by ExternalValues subroutine

2013-05-22 Thread Vodar
Sorry for being annoying. Does anyone have any idea on this?



--
View this message in context: 
http://requesttracker.8502.n7.nabble.com/How-to-get-Custom-Field-s-description-which-setted-by-ExternalValues-subroutine-tp53939p53955.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training


Re: [rt-users] How to get Custom Field's description which setted by ExternalValues subroutine

2013-05-22 Thread Ruslan Zakirov
Hi,

This is description of a value that is not stored along with value on the
ticket or other object value is set on. The only way is to get list of
values, find one that was set on the object and get description. External
Custom Field Values are very sensitive to methods called on collection or
record, so you have to be careful.


On Wed, May 22, 2013 at 1:02 PM, Vodar chri...@gmail.com wrote:

 Sorry for being annoying. Does anyone have any idea on this?



 --
 View this message in context:
 http://requesttracker.8502.n7.nabble.com/How-to-get-Custom-Field-s-description-which-setted-by-ExternalValues-subroutine-tp53939p53955.html
 Sent from the Request Tracker - User mailing list archive at Nabble.com.


 --
 RT Training in Seattle, June 19-20: http://bestpractical.com/training




-- 
Best regards, Ruslan.


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training

[rt-users] How to get Custom Field's description which setted by ExternalValues subroutine

2013-05-21 Thread Chrilly Cheng
Hi All,

I've got a problem with the Custom Field description issue. I created a
custom field named Contact, and when a new ticket is created, I use scrip
to add this Contact user to Requestor list.
I remember that when we set the ExternalValues with code below, we would
pass a description to RT
sub ExternalValues {
..
..
push @res, {
name= $element-{'cont_name'},
description = $element-{'cont_email'},
sortorder   = $i++,
};
..
}

So i want to use this description value to create user or add to mail
list. Can anyone tell me how to get it?

I used code as listed below, but what i got is just the Description value
of this Custom Field, NOT the description of the custom field value I
passed in config file.

my $CF = new RT::CustomField($RT::SystemUser);
$CF-LoadByName( Queue = $ticket-QueueObj-id, Name = $CFName );
$Email = $CF-Description();

Any suggestions would be help, thanks a lot.

-- 
*Br*
*Vodar*
*It's not where you start -- it's where you finish that count.*


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training