[rt-users] Scrip help please.

Kenneth Crocker kfcrocker at lbl.gov
Thu Jun 10 16:40:29 EDT 2010


Paul,

Perhaps I misunderstood. Are you wanting to meet these conditions at the
same time (ie. a create with a CF) or are these to be two separate
conditions exclusive of each other?

Kenn
LBNL

On Wed, Jun 9, 2010 at 3:37 PM, Dougherty Paul <paul_dougherty at prn.com>wrote:

>  Hi Keith,
>
>
>
> These did not help…I have gotten closer to the error, however.
>
>
>
> It seems rather stupid, all I am trying to do is to get the condition to
> ring true in my scrip.
>
>
>
> This is what I have.
>
>
>
> ($self->TicketObj->FirstCustomFieldValue('Urgency') eq "Critical");
>
>
>
>
>
> There are no errors generated by this scrip…but it doesn’t add the
> watchers…(this part works when the above condition is met). For example, if
> I simply use this…($self->TransactionObj->Type eq "Create"); in the
> condition, the scrip adds the watchers.
>
>
>
> Watcher add code:
>
> $self->TicketObj->AddWatcher( Type => "Cc",
>
>                               Email =>"paul_dougherty\@prn.com");
>
> push( @{$self->{'To'}},
>
>       $self->TicketObj->Requestors->MemberEmailAddresses,
>
>       $self->TicketObj->QueueObj->Cc->MemberEmailAddresses );
>
> return 1;
>
>
>
> Any ideas?
>
>
>
> Thanks,
>
>
> Paul
>
>
>
> *From:* Kenneth Crocker [mailto:kfcrocker at lbl.gov]
> *Sent:* Thursday, June 03, 2010 9:00 AM
> *To:* Dougherty Paul
>
> *Subject:* Re: [rt-users] Scrip help please.
>
>
>
> Paul,
>
> I have attached two txt files that have the code in them. These files have
> flower box comments and such that I always use to maintain my code. have fun
> with them.
>
> Kenn
> LBNL
>
> On Thu, Jun 3, 2010 at 8:27 AM, Dougherty Paul <paul_dougherty at prn.com>
> wrote:
>
> Hi Ken,
>
>
>
> Sure, I might be able to use those.
>
>
>
> Thanks,
>
>
>
> Paul
>
>
>
> *From:* rt-users-bounces at lists.bestpractical.com [mailto:
> rt-users-bounces at lists.bestpractical.com] *On Behalf Of *Kenneth Crocker
> *Sent:* Wednesday, June 02, 2010 5:07 PM
> *To:* rt-users at lists.bestpractical.com
> *Subject:* Re: [rt-users] Scrip help please.
>
>
>
> Paul,
>
> I have some code that adds a CC to an individual ticket on a Queue basis.
> So, if you want this for just certain types of tickets, maybe you could
> modify it for those conditions and put it in the Queues relevant to that
> need. OH, I also have some code that add's *additional* Cc's on
> "Correspondence" with those tickets as well. Is that something you might be
> interested in using?
>
> Kenn
> LBNL
>
> On Wed, Jun 2, 2010 at 2:50 PM, Dougherty Paul <paul_dougherty at prn.com>
> wrote:
>
> Hi,
>
>
>
> I am sure this is an id10t error, but I am trying to write a scrip that
> sends an adds a “CC” to a new ticket whose urgency is Critical (or
> critical). So far, the closest I have gotten is to have the system add the
> “CC”’s for every new ticket.
>
>
>
> Here is the custom condition that is giving me the fits. The current error
> I am receiving involves a syntax error…thing is, no matter what I try, I
> cannot get this thing to work. Every other part of this process works (ie,
> when the cc’s are added, the email is sent. The custom action does indeed
> add the cc’s).
>
>
>
> I just need to meet three conditions. One is on create, the other is
> Urgency (custom field) Critical or Urgency critical.
>
>
>
> Thanks,
>
>
> Paul
>
>
>
>
>
> Custom condition:
>
> if ( ($self->TransactionObj->Type eq "Create") &&
>
>                     ( ( $self->TicketObj->FirstCustomFieldValue('Urgency')
> eq "Critical") || ( $self->TicketObj->FirstCustomFieldValue('Urgency') eq
> "critical")))
>
> return 1;
>
> else
>
> return 0;
>
>
>
> Custom action: (runs fine):
>
> $self->TicketObj->AddWatcher( Type => "Cc",
>
>                               Email =>"xxx\@prn.com");
>
> $self->TicketObj->AddWatcher( Type => "Cc",
>
>                               Email =>"xxx\@prn.com");
>
> push( @{$self->{'To'}},
>
>       $self->TicketObj->Requestors->MemberEmailAddresses,
>
>       $self->TicketObj->QueueObj->Cc->MemberEmailAddresses );
>
> return 1;
>
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100610/e820e002/attachment.htm>


More information about the rt-users mailing list