Custom Condition - On Correspond or Comment

Hello All,

I am running RT 4.0.10 on CentOS 6.3.

I was trying to create a user defined condition from the create scrip ui based on a code snippit I found here (http://requesttracker.wikia.com/wiki/CustomConditionSnippets).

On Correspond to Unowned Ticket

return 0 unless $self->TransactionObj->Type eq “Correspond”;
return 0 unless $self->TicketObj->Owner == $RT::Nobody->id;
return 1;

I was wondering if I can add an or in the first statement to make it apply to correspond or comment? Like this:

return 0 unless $self->TransactionObj->Type eq “Correspond” or “Comment”;
return 0 unless $self->TicketObj->Owner == $RT::Nobody->id;
return 1;

Essentially the entire helpdesk has grown tired of being admin CC’s on all queues but we want a way to be able to see correspondence or comments on unowned tickets. I’d prefer not to create two separate scrips. I didn’t want to create the scrips unless I was sure instead of just creating them to see if it would work.

Any help is much appreciated…

Thanks,

James Billington
Mantech International

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

I was wondering if I can add an or in the first statement to make it
apply to correspond or comment? Like this:

return 0 unless $self->TransactionObj->Type eq “Correspond” or “Comment”;

No, that’s not valid Perl. You’d need (line break is purely stylistic):

return 0 unless $self->TransactionObj->Type eq “Correspond”
or $self->TransactionObj->Type eq “Comment”;

Essentially the entire helpdesk has grown tired of being admin CC’s on
all queues but we want a way to be able to see correspondence or
comments on unowned tickets. I’d prefer not to create two separate
scrips. I didn’t want to create the scrips unless I was sure instead of
just creating them to see if it would work.

I just pushed RT::Extension::NotifyBasedOnOwnership to CPAN and public
git. It creates scrip conditions/actions you can use to do what you
want much more cleanly. Look for
RT-Extension-NotifyBasedOnOwnership-0.01 - RT Extension-NotifyBasedOnOwnership Extension - metacpan.org to appear.

Thanks for the quick response and you answered my question perfectly. I’m definitely going to check out the extension as a replacement or more complete solution for this, though it’s not showing up yet from the link you sent. I suppose it’ll take some time.

Thanks again,

James Billington
Mantech InternationalFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Thomas Sibley
Sent: Wednesday, March 13, 2013 1:47 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom Condition - On Correspond or Comment

I was wondering if I can add an or in the first statement to make it
apply to correspond or comment? Like this:

return 0 unless $self->TransactionObj->Type eq “Correspond” or
“Comment”;

No, that’s not valid Perl. You’d need (line break is purely stylistic):

return 0 unless $self->TransactionObj->Type eq “Correspond”
or $self->TransactionObj->Type eq “Comment”;

Essentially the entire helpdesk has grown tired of being admin CC’s on
all queues but we want a way to be able to see correspondence or
comments on unowned tickets. I’d prefer not to create two separate
scrips. I didn’t want to create the scrips unless I was sure instead
of just creating them to see if it would work.

I just pushed RT::Extension::NotifyBasedOnOwnership to CPAN and public git. It creates scrip conditions/actions you can use to do what you want much more cleanly. Look for RT-Extension-NotifyBasedOnOwnership-0.01 - RT Extension-NotifyBasedOnOwnership Extension - metacpan.org to appear.

RT training in Amsterdam, March 20-21: http://bestpractical.com/services/training.html

Help improve RT by taking our user survey: https://www.surveymonkey.com/s/N23JW9T

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

Thanks for the quick response and you answered my question perfectly. I’m definitely going to check out the extension as a replacement or more complete solution for this, though it’s not showing up yet from the link you sent. I suppose it’ll take some time.

google → RT-Extension-NotifyBasedOnOwnership

Thanks again,

James Billington
Mantech International

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Thomas Sibley
Sent: Wednesday, March 13, 2013 1:47 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom Condition - On Correspond or Comment

I was wondering if I can add an or in the first statement to make it
apply to correspond or comment? Like this:

return 0 unless $self->TransactionObj->Type eq “Correspond” or
“Comment”;

No, that’s not valid Perl. You’d need (line break is purely stylistic):

return 0 unless $self->TransactionObj->Type eq “Correspond”
or $self->TransactionObj->Type eq “Comment”;

Essentially the entire helpdesk has grown tired of being admin CC’s on
all queues but we want a way to be able to see correspondence or
comments on unowned tickets. I’d prefer not to create two separate
scrips. I didn’t want to create the scrips unless I was sure instead
of just creating them to see if it would work.

I just pushed RT::Extension::NotifyBasedOnOwnership to CPAN and public git. It creates scrip conditions/actions you can use to do what you want much more cleanly. Look for RT-Extension-NotifyBasedOnOwnership-0.01 - RT Extension-NotifyBasedOnOwnership Extension - metacpan.org to appear.


RT training in Amsterdam, March 20-21: http://bestpractical.com/services/training.html

Help improve RT by taking our user survey: https://www.surveymonkey.com/s/N23JW9T

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.


RT training in Amsterdam, March 20-21: http://bestpractical.com/services/training.html

Help improve RT by taking our user survey: https://www.surveymonkey.com/s/N23JW9T

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Thanks for the quick response and you answered my question perfectly.
I’m definitely going to check out the extension as a replacement or
more complete solution for this, though it’s not showing up yet from
the link you sent. I suppose it’ll take some time.

You happened to have good timing. I already wanted to release that
extension, you just prompted it. The URL now works. Documentation is
at: RT::Extension::NotifyBasedOnOwnership - Adds scrip conditions and actions useful for suppressing notifications to queue watchers when a ticket becomes owned - metacpan.org