RT send 2 mail notification for setting the ticket owner

First mail looks like this,

Sun May 10 12:27:14 2015: Request 242534 was acted upon.

Transaction: Given to rabin by X
Queue: sandbox
Subject: (No subject given)
Owner: rabin
Requestors: rabin
Status: new
Ticket: https://rt

​the 2nd mail notification look like this,

​​​​Sun May 10 12:27:14 2015: Request 242534 was acted upon.

Transaction: Owner set to rabin by X
Queue: sandbox
Subject: (No subject given)
Owner: rabin
Requestors: rabin
Status: new
Ticket: https://rt

​why is that ? ​

​current RT version = 4.2.10
installed from source on ubuntu 12.04​

Rabin

First mail looks like this,

Sun May 10 12:27:14 2015: Request 242534 was acted upon.

Transaction: Given to rabin by X
Queue: sandbox
Subject: (No subject given)
Owner: rabin
Requestors: rabin
Status: new
Ticket: https://rt

​the 2nd mail notification look like this,

​​​​Sun May 10 12:27:14 2015: Request 242534 was acted upon.

Transaction: Owner set to rabin by X
Queue: sandbox
Subject: (No subject given)
Owner: rabin
Requestors: rabin
Status: new
Ticket: https://rt

​why is that ? ​

You have 2 different scrips being triggered by the same transaction. You
can find which scrip is sending which message by looking at the
Message-Id header. An example from my system:

Message-ID: <rt-4.2.9-96149-1430920514-473.15045-118-0@[rt hostname]>

That’s: rt-version-Trans-EpochSec-msecs-Ticket-Scrip-MailSeq@hostname

First mail looks like this,

Sun May 10 12:27:14 2015: Request 242534 was acted upon.

Transaction: Given to rabin by X
Queue: sandbox
Subject: (No subject given)
Owner: rabin
Requestors: rabin
Status: new
Ticket: https://rt

​the 2nd mail notification look like this,

​​​​Sun May 10 12:27:14 2015: Request 242534 was acted upon.

Transaction: Owner set to rabin by X
Queue: sandbox
Subject: (No subject given)
Owner: rabin
Requestors: rabin
Status: new
Ticket: https://rt

​why is that ? ​

You have 2 different scrips being triggered by the same transaction. You
can find which scrip is sending which message by looking at the Message-Id
header. An example from my system:

Message-ID: <rt-4.2.9-96149-1430920514-473.15045-118-0@[rt hostname]>

That’s: rt-version-Trans-EpochSec-msecs-Ticket-Scrip-MailSeq@hostname

​Thank you Bill,
your tip was very helpful (and probably also in the future)​

I found the scrip which send the email notification, but it is not familiar
to me,
the condition is “User defined” but i can’t understand the Perl code,

can you help please ?

my $txn = $self->TransactionObj;
return 0 unless $txn->Field eq “Owner”;
return 0 if $txn->NewValue == $txn->Creator;
return 1;

Rabin

First mail looks like this,

Sun May 10 12:27:14 2015: Request 242534 was acted upon.

Transaction: Given to rabin by X
Queue: sandbox
Subject: (No subject given)
Owner: rabin
Requestors: rabin
Status: new
Ticket: https://rt

​the 2nd mail notification look like this,

​​​​Sun May 10 12:27:14 2015: Request 242534 was acted upon.

Transaction: Owner set to rabin by X
Queue: sandbox
Subject: (No subject given)
Owner: rabin
Requestors: rabin
Status: new
Ticket: https://rt

​why is that ? ​

You have 2 different scrips being triggered by the same transaction.
You
can find which scrip is sending which message by looking at the
Message-Id
header. An example from my system:

Message-ID: <rt-4.2.9-96149-1430920514-473.15045-118-0@[rt hostname]>

That’s: rt-version-Trans-EpochSec-msecs-Ticket-Scrip-MailSeq@hostname

​Thank you Bill,
your tip was very helpful (and probably also in the future)​

I found the scrip which send the email notification,

Based on what you posted, I would expect there to be 2 different scrips,
one for each message. Your solution will probably involve selecting one
of them to keep and disabling the other.

but it is not familiar
to me,
the condition is “User defined” but i can’t understand the Perl code,

can you help please ?


my $txn = $self->TransactionObj;
return 0 unless $txn->Field eq “Owner”;
return 0 if $txn->NewValue == $txn->Creator;
return 1;

That means the scrip action (sending an email notification using the
selected template) will trigger only on transactions that (1) change the
ticket’s “Owner” field and (2) set the new value of “Owner” to a value
that is not equal to the “Creator” field of the transaction. In other
words: the scrip triggers when a user gives a ticket to someone else.

Based on what you posted, I would expect there to be 2 different scrips,
one for each message. Your solution will probably involve selecting one of
them to keep and disabling the other.

but it is not familiar

to me,
the condition is “User defined” but i can’t understand the Perl code,

can you help please ?


my $txn = $self->TransactionObj;
return 0 unless $txn->Field eq “Owner”;
return 0 if $txn->NewValue == $txn->Creator;
return 1;

That means the scrip action (sending an email notification using the
selected template) will trigger only on transactions that (1) change the
ticket’s “Owner” field and (2) set the new value of “Owner” to a value that
is not equal to the “Creator” field of the transaction. In other words: the
scrip triggers when a user gives a ticket to someone else.

​Thank you :slight_smile:
​​

Rabin