Hi Xavier,

A couple of general comments about what you've posted:

1. A custom condition is only checked when you set the condition to User Defined. With it set to On Comment your custom condition is ignored and the scrip fires whenever a comment is detected.

2. If an action is User Defined, the template is ignored. I don't know of a way to have a User Defined action in a scrip use a template. What I do is stick another custom field in the queue and use it to trigger e-mail scrips when I want to send mail as part of a User Defined action, or I perform the desired action within a custom template.

The way I'd do what (I think) you want to do is to use the On Comment condition and then use Notify Other Recipients with a custom template. I'd put your switching code in the template to determine who the message goes to.

Regards,
Gene

At 10:35 AM 8/4/2007, Xavier Ezquerra wrote:
Hello everybody,

Scrip question:

I'm trying to create a "CustomAction" to have communication between
owner and admincc through the commentaries of tickets. It interests to me
to do that any commentary that does one of both receives the other.


# Create new scrip
Configuration -> Global -> Scrips -> New Script

Description: On Comment Notify AdminCCs or Owner with template Admin Comment
Condition: On Comment
Action: User Defined
Template: Admin Comment (custom template )
Stage: TransactionCreate


User Defined conditions and actions
-----------------------------------
Custom condition:

# load id_actor
my $id_actor = $TransactionObj->CreatorObj->Id;

# is owner, send comment to AdminCC
if( $id_actor == $self->TicketObj->OwnerObj->Id ) {
    return 1;

# is AdminCC, send comment to Owner
} elsif ($TicketObj->IsWatcher( Type => 'AdminCC' ) ) {
    return 1;

# is ????, nothing to do
} else {
    return undef;
}


Custom action preparation code:
# empty??

Custom action cleanup code:
# empty??


Custom Field and Scrip Question:
How to detect the new value of custom field, if this changed.


Thanks,

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


--
Gene LeDuc, GSEC
Security Analyst
San Diego State University
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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

Reply via email to