<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff size=2>So to
be a pain but ran into an issue after setting up and testing.
</FONT></SPAN></DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007>>Custom condition:<BR>>{ ### True if
e-mail contains 'ok' - sets owner, resolves ticket<BR>> my
$Transaction = $self->TransactionObj;<BR>> my $CreatorId
= $Transaction->CreatorObj->Id;<BR>> my $Queue =
$self->TicketObj->QueueObj;<BR>> my $val =
$Transaction->Type eq
'Correspond'<BR>>
&&
$Queue->IsAdminCc($CreatorId)<BR>>
&& $Transaction->Content =~
/\bok\s/i;<BR>> return $val;<BR>>}</SPAN></DIV>
<DIV><SPAN class=910462921-27112007></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff size=2>I have
a group of level 1 techs that do not have a unique logon since it is an ever
changing group of folks. is there a way that I can do this based on the domain
name of there email and set it to a specified user?</FONT></SPAN></DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2>something like</FONT></SPAN></DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007><A href="mailto:%@foo.com">%@foo.com</A>
= creatorid 21</SPAN></DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff size=2>Also I
found a way at least for my setup to get it to not send emails to requestors. We
send the message to the comment address and I changed it to
be</FONT></SPAN></DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007>Custom condition:<BR>{ ### True if e-mail
contains 'ok' - sets owner, resolves ticket<BR> my
$Transaction = $self->TransactionObj;<BR> my $CreatorId =
$Transaction->CreatorObj->Id;<BR> my $Queue =
$self->TicketObj->QueueObj;<BR> my $val =
$Transaction->Type eq
'Comment'<BR>
&&
$Queue->IsAdminCc($CreatorId)<BR>
&& $Transaction->Content =~ /\bok\s/i;<BR>
return $val;<BR>}</SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff size=2>and
that works perfect for my level 2 and 3 support groups</FONT></SPAN></DIV>
<DIV><SPAN class=910462921-27112007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=910462921-27112007></SPAN> </DIV>
<DIV align=left>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT size=3><EM>Mark
Fuller<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office"
/><o:p></o:p></EM></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT size=3><EM>BandTel
Engineering<o:p></o:p></EM></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT size=3><EM>603-528-6538 Option
2</EM></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT size=3><EM>603-528-6937
FAX<o:p></o:p></EM></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><FONT
size=3><EM><o:p></o:p></EM></FONT></SPAN> </P></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Gene LeDuc
[mailto:gleduc@mail.sdsu.edu] <BR><B>Sent:</B> Tuesday, November 27, 2007 3:50
PM<BR><B>To:</B> Mark Fuller; Asrai khn<BR><B>Cc:</B>
rt-users@lists.bestpractical.com<BR><B>Subject:</B> RE: [rt-users] take and
resolve actions via email<BR><BR></FONT></DIV>Hi Mark (and
Askar),<BR><BR>After reviewing my previous advice, I've changed my mind.
This should be a cleaner solution.<BR><BR>1. Don't mess with your
templates.<BR><BR>2. I don't know whether _Set works with custom fields,
so I'd use the following to set your CF in the scrip I sent you. The
scrip should probably be a queue scrip, not global, unless you want to do this
for all your queues:<BR>set_custom('noemail', "yes", 0);<BR>### Sets custom
field value<BR>### Usage: set_custom($field_name, $field_value,
$record_transaction)<BR>sub set_custom {<BR> my ($CFName, $CFValue,
$record) = @_;<BR> $record = $record ? 1 : 0;<BR> my $cf =
RT::CustomField->new($RT::SystemUser);<BR> my ($id,$msg) =
$cf->LoadByName(Name=>$CFName,);<BR> if (!$id)
{<BR> $RT::Logger->debug("Error loading custom field
'$CFName'");<BR> return undef;<BR> }<BR> ($id,
$msg) = $Ticket->AddCustomFieldValue<BR>
(Field=>$cf, Value=>$CFValue,
RecordTransaction=>$record);<BR>}<BR><BR>3. Modify your Global Scrips
#6 ("<FONT size=2>On Correspond Notify Requestors and Ccs with template
Correspondence</FONT>") and #7 ("<FONT size=2>On Correspond Notify Other
Recipients with template Correspondence</FONT>") and<BR> a) change the
Condition to User Defined; and<BR> b) put the following code in the
Custom condition area of both scrips:<BR>{ ### True when transaction is
incoming email and CF 'noemail' is not set<BR> my $Transaction =
$self->TransactionObj;<BR> my $Ticket =
$self->TicketObj;<BR> my $val = $Transaction->Type eq
"Correspond"<BR> && !
get_custom("noemail");<BR> return $val;<BR><BR> ### Returns custom
field value<BR> ### get_custom($field_name)<BR> sub get_custom
{<BR> my $target_name = $_[0];<BR> my $val
= $Ticket->FirstCustomFieldValue($target_name);<BR>
return $val if defined $val;<BR> return undef;<BR>
}<BR>}<BR><BR>So you should have 2 scenarios now with incoming
email.<BR>1. Email is from AdminCc and contains trigger word(s) in first
line.<BR> a) Your new scrip fires and sets the CF 'noemail' to 'yes',
Owner to email sender, Status to resolved<BR> b) Global scrip #5 ("<FONT
size=2>On Correspond Notify AdminCcs with template Admin
Correspondence</FONT>") fires and sends mail to AdminCcs<BR> c) Global
scrips #6 and #7 do not fire because CF 'noemail' is set, so no mail is sent
to anyone else<BR><BR>2. Email is not from AdminCc or does not contain
trigger word(s) in first line:<BR> a) Your new scrip does not fire
because both conditions are not met, so CF 'noemail' is not set<BR> b)
Global scrip #5 fires<BR> c) Global scrips #6 and #7 fire because CF
'noemail' either doesn't exist or is not set<BR><BR>Have
fun!<BR><BR>Regards,<BR>Gene<BR><BR>At 10:06 AM 11/27/2007, Mark Fuller
wrote:<BR>
<BLOCKQUOTE class=cite cite="" type="cite">Ok I am very new to this so I
added<BR><BR><BR> $Ticket->_Set(Field => 'noemail', Value =>
'yes', RecordTransaction => 0);<BR><BR>Now how do I tell the
correspondence to look for that. And also if I change<BR>the main script
like that and I have the custom field set how do I get the<BR>filed to be
blank or no so that all future correspondence will work. <BR><BR>Again I am
new to RT but we love it and are expanding it's use. I thought<BR>about
command by email but the CTO is concerned as am I with security and<BR>this
seems the safer way. Also we do want to comment via email<BR><BR>Mark
Fuller<BR><BR>BandTel Engineering<BR><BR>603-528-6538 Option
2<BR><BR>603-528-6937 FAX<BR><BR>-----Original Message-----<BR>From: Gene
LeDuc [<A href="mailto:gleduc@mail.sdsu.edu" eudora="autourl">
mailto:gleduc@mail.sdsu.edu</A>] <BR>Sent: Monday, November 26, 2007 4:27
PM<BR>To: Mark Fuller<BR>Cc: rt-users@lists.bestpractical.com<BR>Subject:
RE: [rt-users] take and resolve actions via email<BR><BR>Hi Mark,<BR><BR>I'm
not sure how you could change a correspondence transaction to a
<BR>comment. However...<BR><BR>If I wanted to just change the way that
email is sent (only AdminCcs <BR>getting an email), I'd add a custom field
to the queue called <BR>"NoCorrespond" and then modify the Correspondence
template used for the "On <BR>Correspond" scrip to include a check at the
beginning to see if there is a <BR>"NoCorrespond" field and whether it has
anything in it. If so, exit the <BR>template and don't send the email,
otherwise proceed as usual. Then I'd <BR>have the scrip I gave you put
something into the "NoCorrespond" custom <BR>field at the same time that it
sets the owner and status. It's kind of <BR>clunky and there are
probably more elegant solutions, but I think it would <BR>work. You
might also want to make another scrip to send the mail to the <BR>AdminCc
when the "NoCorrespond" field gets something assigned to it (by <BR>your
other scrip), something like (I haven't tried this scrip, so it may <BR>need
work):<BR><BR>Condition: User Defined<BR>Action: Notify AdminCcs as
Comment<BR>Template: Global template: Admin Comment<BR>Custom condtion:<BR>{
### True on state change to "NoCorrespond"<BR> my $Transaction =
$self->TransactionObj;<BR> my $val = $Transaction->Type eq
"CustomField"<BR> &&
$Transaction->Field eq
"NoCorrespond"<BR> ;<BR>
return $val;<BR>}<BR><BR>Good luck!<BR>Gene<BR><BR>At 12:00 PM 11/26/2007,
Mark Fuller wrote:<BR>>Thanks Gene it works great but.. Is there a way to
make it a comment so <BR>>only admin staff gets it<BR>><BR>>Mark
Fuller<BR>><BR>>-----Original Message-----<BR>>From: Gene LeDuc [<A
href="mailto:gleduc@mail.sdsu.edu" eudora="autourl">
mailto:gleduc@mail.sdsu.edu</A>]<BR>>Sent: Monday, November 26, 2007
12:26 PM<BR>>To: Mark Fuller<BR>>Cc:
rt-users@lists.bestpractical.com<BR>>Subject: RE: [rt-users] take and
resolve actions via email<BR>><BR>><BR>>Hi
Mark,<BR>><BR>>Here's the scrip we use to resolve tickets via
e-mail.<BR>><BR>>In order to resolve a ticket this way, the e-mail
must be from an <BR>>AdminCc for that queue and it must contain the word
"Ok" on the first <BR>>line.<BR>><BR>>Description: Resolved by
e-mail<BR>>Condition: User Defined<BR>>Action: User
Defined<BR>>Template: Global template: Blank<BR>>Stage:
TransactionCreate<BR>><BR>>Custom condition:<BR>>{ ### True if
e-mail contains 'ok' - sets owner, resolves ticket<BR>>
my $Transaction = $self->TransactionObj;<BR>> my
$CreatorId = $Transaction->CreatorObj->Id;<BR>>
my $Queue = $self->TicketObj->QueueObj;<BR>> my
$val = $Transaction->Type eq
'Correspond'<BR>>
&&
$Queue->IsAdminCc($CreatorId)<BR>>
&& $Transaction->Content =~
/\bok\s/i;<BR>> return
$val;<BR>>}<BR>><BR>>Custom action prep code:<BR>>return
1;<BR>><BR>>Custom action cleanup code:<BR>>### Set Set owner to
e-mail sender, status to 'resolved'<BR>>my $Ticket =
$self->TicketObj;<BR>>my $Transaction =
$self->TransactionObj;<BR>>my $CreatorId =
$Transaction->CreatorObj->Id;
<BR>>$Ticket->_Set(Field=>'Owner', Value=>$CreatorId,
RecordTransaction=>0); <BR>>$Ticket->_Set(Field => 'Status',
Value => 'resolved', RecordTransaction <BR>>=>
0);<BR>><BR>>The 2 lines at the end of the cleanup code could also
be:<BR>>
$Ticket->SetOwner($CreatorId);<BR>>
$Ticket->SetStatus('resolved');<BR>>but I use _Set instead because I
don't want to fire off any more <BR>>transactions when I resolve tickets
this way.<BR>><BR>>Regards,<BR>>Gene</BLOCKQUOTE><X-SIGSEP>
<P></X-SIGSEP><BR>-- <BR>Gene LeDuc, GSEC<BR>Security Analyst<BR>San Diego
State University </P></BLOCKQUOTE></BODY></HTML>