Help with scrip (search correspond body)

Need a little help and would appreciate any advice.
I am trying to write a scrip for
"On Correspond Notify Requestors and Ccs"
I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;
$RT::Logger->error($Content);
if( $Content =~ m/Status:/ ){
$RT::Logger->error("—>found Status…");
return 0;
}
$RT::Logger->error("—>NOT FOUND!!!");
return 1;

but for some reason the content is always blank, and even weirder it somehow gets in the if statement and logs "—>found status…"
so first off why is it not finding the content, I want to simply check the body of the email for a string, which I found multiple places on the wiki and list using the above way. Second why is the if statement finding “Status:” in an empty string??

Ive also tried
my $Attachment = $self->TicketObj->TransactionObj->Attachments;
my $Content = $Attachment->First->Content;
but I get an error on that saying:
ug 12 15:48:01 rt RT: Scrip 6 IsApplicable failed: Can’t locate object method “Attachments” via package “No object mapping for field” (perhaps you forgot to load “No object mapping for field”?) at (eval 538) line 1. Stack: [(eval 538):1] [/opt/rt4/sbin/…/lib/RT/ScripCondition.pm:207] [/opt/rt4/sbin/…/lib/RT/Scrip.pm:410] [/opt/rt4/sbin/…/lib/RT/Scrips.pm:225] [/opt/rt4/sbin/…/lib/RT/Transaction.pm:179] [/opt/rt4/sbin/…/lib/RT/Record.pm:1447] [/opt/rt4/sbin/…/lib/RT/Ticket.pm:2237] [/opt/rt4/sbin/…/lib/RT/Ticket.pm:2145] [/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Email/Filter/TakeAction.pm:341] [/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:1612] [/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:1429] [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61] (/opt/rt4/sbin/…/lib/RT/Condition/UserDefined.pm:65)From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Robert Vicchiullo
Sent: Friday, August 12, 2011 1:57 PM
To: RT-Users@lists.bestpractical.com
Subject: [rt-users] help with scrip (search correspond body)

Need a little help and would appreciate any advice.
I am trying to write a scrip for
"On Correspond Notify Requestors and Ccs"
I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;
$RT::Logger->error($Content);
if( $Content =~ m/Status:/ ){
$RT::Logger->error("—>found Status…");
return 0;
}
$RT::Logger->error("—>NOT FOUND!!!");
return 1;

but for some reason the content is always blank, and even weirder it somehow gets in the if statement and logs "—>found status…"
so first off why is it not finding the content, I want to simply check the body of the email for a string, which I found multiple places on the wiki and list using the above way. Second why is the if statement finding “Status:” in an empty string??

Need a little help and would appreciate any advice.

I am trying to write a scrip for

“On Correspond Notify Requestors and Ccs”

I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;

Try the following:

$self->TransactionObj->Content;

It will find text part in the message and return it content.

[snip]

Best regards, Ruslan.

Ok that’s worked and I have the following
my $Content = $self->TransactionObj->Content;
if( $Content =~ m/Status: resolved/){
return 0;
}
return 1;

problem is when the Content does match and it does return 0;
it sends out an email and says " This transaction appears to have no content"-----Original Message-----
From: ruslan.zakirov@gmail.com [mailto:ruslan.zakirov@gmail.com] On Behalf Of Ruslan Zakirov
Sent: Sunday, August 14, 2011 1:59 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

On Sat, Aug 13, 2011 at 12:57 AM, Robert Vicchiullo rob@hautelook.com wrote:

Need a little help and would appreciate any advice.

I am trying to write a scrip for

“On Correspond Notify Requestors and Ccs”

I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;

Try the following:

$self->TransactionObj->Content;

It will find text part in the message and return it content.

[snip]

Best regards, Ruslan.

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?On Wed, Aug 17, 2011 at 2:44 AM, Robert Vicchiullo rob@hautelook.com wrote:

Ok that’s worked and I have the following
my $Content = $self->TransactionObj->Content;
if( $Content =~ m/Status: resolved/){
return 0;
}
return 1;

problem is when the Content does match and it does return 0;
it sends out an email and says " This transaction appears to have no content"

-----Original Message-----
From: ruslan.zakirov@gmail.com [mailto:ruslan.zakirov@gmail.com] On Behalf Of Ruslan Zakirov
Sent: Sunday, August 14, 2011 1:59 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

On Sat, Aug 13, 2011 at 12:57 AM, Robert Vicchiullo rob@hautelook.com wrote:

Need a little help and would appreciate any advice.

I am trying to write a scrip for

“On Correspond Notify Requestors and Ccs”

I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;

Try the following:

$self->TransactionObj->Content;

It will find text part in the message and return it content.

[snip]


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011

Best regards, Ruslan.

i am using the CommandByEmail.
the problem is when the helpdesk replies to emails it sends out the commands to the requester.
i am trying to write some custom things to block those corresponds from going to the requester. so if they someone closes a ticket via email the requester will get the email with the Status: resolved in it as well as the default templated email saying it was closed.

and i know we could send the requests to the comment email, but we are coming from another ticketing system where there was only 1 email and i would rather not have to have everyone always remember to do that. writing this seemed like it would be pretty easy. just need to work out the kinks.From: ruslan.zakirov@gmail.com [ruslan.zakirov@gmail.com] on behalf of Ruslan Zakirov [ruz@bestpractical.com]
Sent: Tuesday, August 16, 2011 3:49 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?

Robert,

Have you tried creating two different resolve notification scrips? 1 for the
requestor (that uses a template with no content) and 1 for others that uses
a template with all the content? I’m not sure if that is what you wanted,
but it’s a thought.

Kenn
LBNLOn Wed, Aug 17, 2011 at 1:34 AM, Robert Vicchiullo rob@hautelook.comwrote:

i am using the CommandByEmail.
the problem is when the helpdesk replies to emails it sends out the
commands to the requester.
i am trying to write some custom things to block those corresponds from
going to the requester. so if they someone closes a ticket via email the
requester will get the email with the Status: resolved in it as well as the
default templated email saying it was closed.

and i know we could send the requests to the comment email, but we are
coming from another ticketing system where there was only 1 email and i
would rather not have to have everyone always remember to do that. writing
this seemed like it would be pretty easy. just need to work out the kinks.


From: ruslan.zakirov@gmail.com [ruslan.zakirov@gmail.com] on behalf of
Ruslan Zakirov [ruz@bestpractical.com]
Sent: Tuesday, August 16, 2011 3:49 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?

On Wed, Aug 17, 2011 at 2:44 AM, Robert Vicchiullo rob@hautelook.com wrote:

Ok that’s worked and I have the following
my $Content = $self->TransactionObj->Content;
if( $Content =~ m/Status: resolved/){
return 0;
}
return 1;

problem is when the Content does match and it does return 0;
it sends out an email and says " This transaction appears to have no
content"

-----Original Message-----
From: ruslan.zakirov@gmail.com [mailto:ruslan.zakirov@gmail.com] On
Behalf Of Ruslan Zakirov
Sent: Sunday, August 14, 2011 1:59 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

On Sat, Aug 13, 2011 at 12:57 AM, Robert Vicchiullo rob@hautelook.com wrote:

Need a little help and would appreciate any advice.

I am trying to write a scrip for

“On Correspond Notify Requestors and Ccs”

I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;

Try the following:

$self->TransactionObj->Content;

It will find text part in the message and return it content.

[snip]


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011

Hi,

Instead of customizing conditions you should probably take a look into
templates. Each template that inserts Content of a message into
outgoing email has { $Transaction->Content } block. You can change
content in that block. In your case I think you want to delete
commands from the content.On Wed, Aug 17, 2011 at 12:34 PM, Robert Vicchiullo rob@hautelook.com wrote:

i am using the CommandByEmail.
the problem is when the helpdesk replies to emails it sends out the commands to the requester.
i am trying to write some custom things to block those corresponds from going to the requester. so if they someone closes a ticket via email the requester will get the email with the Status: resolved in it as well as the default templated email saying it was closed.

and i know we could send the requests to the comment email, but we are coming from another ticketing system where there was only 1 email and i would rather not have to have everyone always remember to do that. writing this seemed like it would be pretty easy. just need to work out the kinks.


From: ruslan.zakirov@gmail.com [ruslan.zakirov@gmail.com] on behalf of Ruslan Zakirov [ruz@bestpractical.com]
Sent: Tuesday, August 16, 2011 3:49 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?

On Wed, Aug 17, 2011 at 2:44 AM, Robert Vicchiullo rob@hautelook.com wrote:

Ok that’s worked and I have the following
my $Content = $self->TransactionObj->Content;
if( $Content =~ m/Status: resolved/){
return 0;
}
return 1;

problem is when the Content does match and it does return 0;
it sends out an email and says " This transaction appears to have no content"

-----Original Message-----
From: ruslan.zakirov@gmail.com [mailto:ruslan.zakirov@gmail.com] On Behalf Of Ruslan Zakirov
Sent: Sunday, August 14, 2011 1:59 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

On Sat, Aug 13, 2011 at 12:57 AM, Robert Vicchiullo rob@hautelook.com wrote:

Need a little help and would appreciate any advice.

I am trying to write a scrip for

“On Correspond Notify Requestors and Ccs”

I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;

Try the following:

$self->TransactionObj->Content;

It will find text part in the message and return it content.

[snip]


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011


Best regards, Ruslan.

Best regards, Ruslan.

I don’t want to stop the resolved email from going out. I want to stop the commands that CommandByMail uses being sent to the requestor.

So for example you can reply to ticket with Status: resolved and the requestor with get that email with the content being just Status: resolved and then they will ALSO get the official resolved email as well. I don’t want them to get the command email.From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth Crocker
Sent: Wednesday, August 17, 2011 9:01 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Robert,

Have you tried creating two different resolve notification scrips? 1 for the requestor (that uses a template with no content) and 1 for others that uses a template with all the content? I’m not sure if that is what you wanted, but it’s a thought.

Kenn
LBNL

i am using the CommandByEmail.
the problem is when the helpdesk replies to emails it sends out the commands to the requester.
i am trying to write some custom things to block those corresponds from going to the requester. so if they someone closes a ticket via email the requester will get the email with the Status: resolved in it as well as the default templated email saying it was closed.

and i know we could send the requests to the comment email, but we are coming from another ticketing system where there was only 1 email and i would rather not have to have everyone always remember to do that. writing this seemed like it would be pretty easy. just need to work out the kinks.

From: ruslan.zakirov@gmail.commailto:ruslan.zakirov@gmail.com [ruslan.zakirov@gmail.commailto:ruslan.zakirov@gmail.com] on behalf of Ruslan Zakirov [ruz@bestpractical.commailto:ruz@bestpractical.com]
Sent: Tuesday, August 16, 2011 3:49 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.commailto:RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?

Robert,

As I mentioned earlier, YOU can control what goes out on an email via the
template. Why don’t you just modify the “resolve” template to NOT put the
info on that you do not want?

Kenn
LBNLOn Thu, Aug 18, 2011 at 1:16 PM, Robert Vicchiullo rob@hautelook.comwrote:

I don’t want to stop the resolved email from going out. I want to stop
the commands that CommandByMail uses being sent to the requestor.****


So for example you can reply to ticket with Status: resolved and the
requestor with get that email with the content being just Status: resolved
and then they will ALSO get the official resolved email as well. I don’t
want them to get the command email.****



From: rt-users-bounces@lists.bestpractical.com [mailto:
rt-users-bounces@lists.bestpractical.com] *On Behalf Of *Kenneth Crocker
Sent: Wednesday, August 17, 2011 9:01 AM
To: rt-users@lists.bestpractical.com

Subject: Re: [rt-users] help with scrip (search correspond body)****


Robert,

Have you tried creating two different resolve notification scrips? 1 for
the requestor (that uses a template with no content) and 1 for others that
uses a template with all the content? I’m not sure if that is what you
wanted, but it’s a thought.

Kenn
LBNL****

On Wed, Aug 17, 2011 at 1:34 AM, Robert Vicchiullo rob@hautelook.com
wrote:****

i am using the CommandByEmail.
the problem is when the helpdesk replies to emails it sends out the
commands to the requester.
i am trying to write some custom things to block those corresponds from
going to the requester. so if they someone closes a ticket via email the
requester will get the email with the Status: resolved in it as well as the
default templated email saying it was closed.

and i know we could send the requests to the comment email, but we are
coming from another ticketing system where there was only 1 email and i
would rather not have to have everyone always remember to do that. writing
this seemed like it would be pretty easy. just need to work out the kinks.


From: ruslan.zakirov@gmail.com [ruslan.zakirov@gmail.com] on behalf of
Ruslan Zakirov [ruz@bestpractical.com]
Sent: Tuesday, August 16, 2011 3:49 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?

On Wed, Aug 17, 2011 at 2:44 AM, Robert Vicchiullo rob@hautelook.com wrote:

Ok that’s worked and I have the following
my $Content = $self->TransactionObj->Content;
if( $Content =~ m/Status: resolved/){
return 0;
}
return 1;

problem is when the Content does match and it does return 0;
it sends out an email and says " This transaction appears to have no
content"

-----Original Message-----
From: ruslan.zakirov@gmail.com [mailto:ruslan.zakirov@gmail.com] On
Behalf Of Ruslan Zakirov
Sent: Sunday, August 14, 2011 1:59 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

On Sat, Aug 13, 2011 at 12:57 AM, Robert Vicchiullo rob@hautelook.com wrote:

Need a little help and would appreciate any advice.

I am trying to write a scrip for

“On Correspond Notify Requestors and Ccs”

I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;

Try the following:

$self->TransactionObj->Content;

It will find text part in the message and return it content.

[snip]


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011****

Because the commands aren’t in the resolve message. They are just in corresponds.
And they are always by themselves.
So it would just be an email with a command. I do not want those emails to go to the requestor.
So if I edit the template to remove commands it will still send an email but now it will be blank.From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth Crocker
Sent: Thursday, August 18, 2011 2:16 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Robert,

As I mentioned earlier, YOU can control what goes out on an email via the template. Why don’t you just modify the “resolve” template to NOT put the info on that you do not want?

Kenn
LBNL

I don’t want to stop the resolved email from going out. I want to stop the commands that CommandByMail uses being sent to the requestor.

So for example you can reply to ticket with Status: resolved and the requestor with get that email with the content being just Status: resolved and then they will ALSO get the official resolved email as well. I don’t want them to get the command email.

From: rt-users-bounces@lists.bestpractical.commailto:rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.commailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth Crocker
Sent: Wednesday, August 17, 2011 9:01 AM
To: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com

Subject: Re: [rt-users] help with scrip (search correspond body)

Robert,

Have you tried creating two different resolve notification scrips? 1 for the requestor (that uses a template with no content) and 1 for others that uses a template with all the content? I’m not sure if that is what you wanted, but it’s a thought.

Kenn
LBNL

i am using the CommandByEmail.
the problem is when the helpdesk replies to emails it sends out the commands to the requester.
i am trying to write some custom things to block those corresponds from going to the requester. so if they someone closes a ticket via email the requester will get the email with the Status: resolved in it as well as the default templated email saying it was closed.

and i know we could send the requests to the comment email, but we are coming from another ticketing system where there was only 1 email and i would rather not have to have everyone always remember to do that. writing this seemed like it would be pretty easy. just need to work out the kinks.

From: ruslan.zakirov@gmail.commailto:ruslan.zakirov@gmail.com [ruslan.zakirov@gmail.commailto:ruslan.zakirov@gmail.com] on behalf of Ruslan Zakirov [ruz@bestpractical.commailto:ruz@bestpractical.com]
Sent: Tuesday, August 16, 2011 3:49 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.commailto:RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?

Robert,

As I mentioned earlier, YOU can control what goes out on an email via the
template. Why don’t you just modify the “resolve” template to NOT put the
info on that you do not want?

Kenneth, you forget that “On Resolve” condition triggers on status change action
that has no Content. It’s described in FAQ.

Robert here has different problem. Staff members close tickets using
CommandByEmail
and replies without additional text that would be helpful to
requestors. People receive
mails without valuable info, just bunch of meaning less commands.

Robert, at the end you need two things to solve this properly:

  1. “On Correspond With Content” condition
  2. Templates that strip commands from content

In both task you get content and delete commands from it. If after
deleting content is not empty then condition should succeed.

Code that strips commands you can borrow from the extension.

Kenn
LBNL

I don’t want to stop the resolved email from going out. I want to stop the
commands that CommandByMail uses being sent to the requestor.

So for example you can reply to ticket with Status: resolved and the
requestor with get that email with the content being just Status: resolved
and then they will ALSO get the official resolved email as well. I don’t
want them to get the command email.

From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth
Crocker
Sent: Wednesday, August 17, 2011 9:01 AM
To: rt-users@lists.bestpractical.com

Subject: Re: [rt-users] help with scrip (search correspond body)

Robert,

Have you tried creating two different resolve notification scrips? 1 for
the requestor (that uses a template with no content) and 1 for others that
uses a template with all the content? I’m not sure if that is what you
wanted, but it’s a thought.

Kenn
LBNL

i am using the CommandByEmail.
the problem is when the helpdesk replies to emails it sends out the
commands to the requester.
i am trying to write some custom things to block those corresponds from
going to the requester. so if they someone closes a ticket via email the
requester will get the email with the Status: resolved in it as well as the
default templated email saying it was closed.

and i know we could send the requests to the comment email, but we are
coming from another ticketing system where there was only 1 email and i
would rather not have to have everyone always remember to do that. writing
this seemed like it would be pretty easy. just need to work out the kinks.


From: ruslan.zakirov@gmail.com [ruslan.zakirov@gmail.com] on behalf of
Ruslan Zakirov [ruz@bestpractical.com]
Sent: Tuesday, August 16, 2011 3:49 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?

Ok that’s worked and I have the following
my $Content = $self->TransactionObj->Content;
if( $Content =~ m/Status: resolved/){
return 0;
}
return 1;

problem is when the Content does match and it does return 0;
it sends out an email and says " This transaction appears to have no
content"

-----Original Message-----
From: ruslan.zakirov@gmail.com [mailto:ruslan.zakirov@gmail.com] On
Behalf Of Ruslan Zakirov
Sent: Sunday, August 14, 2011 1:59 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Need a little help and would appreciate any advice.

I am trying to write a scrip for

“On Correspond Notify Requestors and Ccs”

I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;

Try the following:

$self->TransactionObj->Content;

It will find text part in the message and return it content.

[snip]


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA — September 26 & 27, 2011
  • San Francisco, CA, USA — October 18 & 19, 2011
  • Washington DC, USA — October 31 & November 1, 2011
  • Melbourne VIC, Australia — November 28 & 29, 2011
  • Barcelona, Spain — November 28 & 29, 2011

Best regards, Ruslan.

heh, ok understood, just not sure where to begin.From: rt-users-bounces@lists.bestpractical.com [rt-users-bounces@lists.bestpractical.com] on behalf of Ruslan Zakirov [ruz@bestpractical.com]
Sent: Thursday, August 18, 2011 2:41 PM
To: Kenneth Crocker
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Robert,

As I mentioned earlier, YOU can control what goes out on an email via the
template. Why don’t you just modify the “resolve” template to NOT put the
info on that you do not want?

Kenneth, you forget that “On Resolve” condition triggers on status change action
that has no Content. It’s described in FAQ.

Robert here has different problem. Staff members close tickets using
CommandByEmail
and replies without additional text that would be helpful to
requestors. People receive
mails without valuable info, just bunch of meaning less commands.

Robert, at the end you need two things to solve this properly:

  1. “On Correspond With Content” condition
  2. Templates that strip commands from content

In both task you get content and delete commands from it. If after
deleting content is not empty then condition should succeed.

Code that strips commands you can borrow from the extension.

Kenn
LBNL

I don’t want to stop the resolved email from going out. I want to stop the
commands that CommandByMail uses being sent to the requestor.

So for example you can reply to ticket with Status: resolved and the
requestor with get that email with the content being just Status: resolved
and then they will ALSO get the official resolved email as well. I don’t
want them to get the command email.

From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth
Crocker
Sent: Wednesday, August 17, 2011 9:01 AM
To: rt-users@lists.bestpractical.com

Subject: Re: [rt-users] help with scrip (search correspond body)

Robert,

Have you tried creating two different resolve notification scrips? 1 for
the requestor (that uses a template with no content) and 1 for others that
uses a template with all the content? I’m not sure if that is what you
wanted, but it’s a thought.

Kenn
LBNL

i am using the CommandByEmail.
the problem is when the helpdesk replies to emails it sends out the
commands to the requester.
i am trying to write some custom things to block those corresponds from
going to the requester. so if they someone closes a ticket via email the
requester will get the email with the Status: resolved in it as well as the
default templated email saying it was closed.

and i know we could send the requests to the comment email, but we are
coming from another ticketing system where there was only 1 email and i
would rather not have to have everyone always remember to do that. writing
this seemed like it would be pretty easy. just need to work out the kinks.


From: ruslan.zakirov@gmail.com [ruslan.zakirov@gmail.com] on behalf of
Ruslan Zakirov [ruz@bestpractical.com]
Sent: Tuesday, August 16, 2011 3:49 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Hi,

What exactly are you trying to do? Why do you need custom condition
when RT has “On Correspond” out of the box?

Ok that’s worked and I have the following
my $Content = $self->TransactionObj->Content;
if( $Content =~ m/Status: resolved/){
return 0;
}
return 1;

problem is when the Content does match and it does return 0;
it sends out an email and says " This transaction appears to have no
content"

-----Original Message-----
From: ruslan.zakirov@gmail.com [mailto:ruslan.zakirov@gmail.com] On
Behalf Of Ruslan Zakirov
Sent: Sunday, August 14, 2011 1:59 PM
To: Robert Vicchiullo
Cc: RT-Users@lists.bestpractical.com
Subject: Re: [rt-users] help with scrip (search correspond body)

Need a little help and would appreciate any advice.

I am trying to write a scrip for

“On Correspond Notify Requestors and Ccs”

I have Condition set to User defined and stage set to transactionbatch.

In Custom condition I have:

my $Content = $self->TransactionObj->Attachments->First->Content;

Try the following:

$self->TransactionObj->Content;

It will find text part in the message and return it content.

[snip]


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011


Best regards, Ruslan.

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA — September 26 & 27, 2011
  • San Francisco, CA, USA — October 18 & 19, 2011
  • Washington DC, USA — October 31 & November 1, 2011
  • Melbourne VIC, Australia — November 28 & 29, 2011
  • Barcelona, Spain — November 28 & 29, 2011

Best regards, Ruslan.
RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011