Gene,
Sorry for all the hassle. In the Perl class I took, I got the
impression that it didn't matter what type of brackets you used, as long
as they matched left right. Also, why do you use == in the second
line? Why not just another eq? Another question; I was under the
impression that
Gene,
I just tried the code:
my $trans = $self-TransactionObj;
return ($trans-Type eq CustomField
$trans-Field == get_custom_id(Approval-Status)
$trans-NewValue eq Reviewing Request);
and I got the error * Custom field value Reviewing Request could not be
found for
At Friday 5/18/2007 12:09 PM, Kenneth Crocker wrote:
Gene,
Sorry for all the hassle. In the Perl class I took, I got
the impression that it didn't matter what type of brackets you
used, as long as they matched left right. Also, why do you use ==
in the second line? Why not just
At Friday 5/18/2007 12:09 PM, Kenneth Crocker wrote:
Gene,
Sorry for all the hassle. In the Perl class I took, I got
the impression that it didn't matter what type of brackets you
used, as long as they matched left right. Also, why do you use ==
in the second line? Why not just
I used == in the second comparison instead of eq because that's what
you had. It should work because the CF id is an integer and
get_custom_id() returns an integer or undef, so you're comparing
integers. Sometimes perl is pretty good about making things work when they
aren't quite correct,
Kenn,
The following code might do what you need - it's taken from a similar
scrip we use.
Steve
my $trans = $self-TransactionObj;
if ($trans-Type eq 'CustomField') {
my $cf = new RT::CustomField($RT::SystemUser);
$cf-LoadByName(Queue = $self-TicketObj-QueueObj-id,
Stephan,
A question; why do you have ($trans-NewValue
$trans-NewValue eq Reviewing Request)
in the code? it looks like $trans-NewValue is in there twice. I don't
understand why it is not just
if ($trans-Field == $cf-id
$trans-NewValue eq Reviewing
At Friday 5/18/2007 01:19 PM, Kenneth Crocker wrote:
Stephan,
A question; why do you have ($trans-NewValue
$trans-NewValue eq Reviewing Request)
in the code? it looks like $trans-NewValue is in there
twice. I don't understand why it is not just
if
Stephan,
I have another question; why all the references to QueueObj? On page
129 of the RT Essentials book (in reference to Transactions, I am
assuming transactions generated by changing a field, etc.) it says For
updates that alter a field or custom field, field tracks what was
changed.
At Friday 5/18/2007 01:33 PM, Kenneth Crocker wrote:
Stephan,
I have another question; why all the references to
QueueObj? On page 129 of the RT Essentials book (in reference to
Transactions, I am assuming transactions generated by changing a
field, etc.) it says For updates that
Gene,
I created the CF as select one value and a list of about 6 different
values, all of which show when update the cf. It is applied to Tickets
and I have it applied to the Queue I am using for the test. That's why
the error doesn't make sense to me. Every time I change it to some
Gene,
Upon further thought, maybe the fact that the CF is defined as select
ONE value it tries to delete the old value associated with the ticket
since it is being replaced with another value. Or maybe it updates the
ticket custom field first with the new value and then tries to delete
the
Stephen,
Thanks a bunch. I used your code (with a little modification) as
follows:
my $trans = $self-TransactionObj;
my $ticket = $self-TicketObj;
if ($trans-Type eq 'CustomField')
{my $cf = new RT::CustomField($RT::SystemUser);
$cf-LoadByName(Queue = $ticket-QueueObj-id,
To all,
I am new to RT and Perl. I have been trying to learn how to change some
of this stuff by looking at the code you all write about as well as look
at the RT Essentials book. I have a new scrip that has the following
parameters set:
Condition: User Defined
Action: NotifyOwner
Kenn, you're using curly brackets to enclose the condition phrase. In this
case you really don't need to enclose it at all, but if you do then you
need to use parentheses.
This should work:
return 1 if $trans-Type eq CustomField $trans-Field ==
get_custom_id(Approval-Status)
15 matches
Mail list logo