<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>RT 3.6.7</div><div>OS:<span class="Apple-tab-span" style="white-space:pre"> </span>Linux</div><div><br></div><div><br></div><div>Purpose:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Using a Scrip, I am trying to set/assign Custom Fields (from a list of pre-defined Custom Fields in Queue-A) to tickets being sent to Queue-A. </div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>My code below (Scrip) simply parses the Subject line of incoming tickets, and "should" attempt to create (& update) an incoming Ticket based on what shows up in the Subject line.</div><div><br></div><div>Problem:<span class="Apple-tab-span" style="white-space:pre"> </span></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Tickets do get created as I send my emails to RT, yet they do not get set with the Custom Field (from a pre-defined set of custom fields), and Custom Field stays as "no value"</div><div><br></div><div>A) my Scrip parameters (using the web interface)</div><div>======================================</div><div>Scrip Description:<span class="Apple-tab-span" style="white-space:pre"> </span>OnCreateAddCF</div><div>Condition:<span class="Apple-tab-span" style="white-space:pre"> </span>On Correspond</div><div>Action:<span class="Apple-tab-span" style="white-space:pre"> </span>User Defined</div><div>Template:<span class="Apple-tab-span" style="white-space:pre"> </span>Correspondence-XYZ</div><div>Stage:<span class="Apple-tab-span" style="white-space:pre"> </span>TransactionCreate</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Custom condition:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Custom action preparation code:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>my %cf_hash<span class="Apple-tab-span" style="white-space:pre"> </span>= (</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>"some-text1" => 1,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>"<b>some-text2</b>" <span class="Apple-tab-span" style="white-space:pre"> </span>=> 1,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>"some-text3" => 1,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>my $cf_key;</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#Current Subject & 'Queue Name'</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>my $t_subject<span class="Apple-tab-span" style="white-space:pre"> </span>= $self->TicketObj->Subject;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>my $queue<span class="Apple-tab-span" style="white-space:pre"> </span>= $self->TicketObj->QueueObj->Name;<span class="Apple-tab-span" style="white-space:pre"> </span>#Not being used, as my Scrip is Queue-specific (being applied to Queue-A)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#Custom Field Name to be Set</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>my $cf<span class="Apple-tab-span" style="white-space:pre"> </span>= RT::CustomField->new(RT->SystemUser);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>#Set Ticket's CustomField, based on Subject line!</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>foreach $cf_key (keys %cf_hash)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if ( $t_subject =~ /$cf_key/i ) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>$cf->LoadByName(Name<span class="Apple-tab-span" style="white-space:pre"> </span>=><span class="Apple-tab-span" style="white-space:pre"> </span>$cf_key;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}<span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>1;</div></div><div><br></div><div>Custom action cleanup code:</div><div><br></div><div><br></div><div>B) My Tickets are sent via email to <a href="mailto:Queue-A@xxxx.com">Queue-A@xxxx.com</a></div><div>===========================================</div><div><br></div><div>Subject line of email to <a href="mailto:Queue-A@xxxx.com">Queue-A@xxxx.com</a>: Testing -- <b>some-text2</b></div><div><b><br></b></div><div><br></div><div>NOTES:</div><div><br></div><div>1) Using the Web interface, when I try to "Reply" to the tickets that get created, my Scrip does not even show up as one of the Scrips that is being evaluated. Yet, other Scrips that I have personally created do show up as Scrips that will get triggered (shown below).</div><div><br></div><div>2) My User Status: </div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>-I am an end-user of RT, without any admin privileges on the RT system</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>-I have the proper ACL to write, show, etc.....for Queue-A</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>-I can successfully create tickets in Queue-A (both through email & web interface)</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>-I can successfully create Scrips that will get triggered, based on Scrip "Action" being anything other than "User Defined" (i.e., "AutoReply To Requestors")</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>-I don't have access to RT::Logger (based on our shop setup)</div><div><br></div><div><br></div><div></div></body></html>