<div class="gmail_quote">
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>I changed this </div>
<div> </div>
<div>
<div class="im">$TicketsObj->LimitStatus(VALUE => 'new');<br>$TicketsObj->LimitStatus(VALUE => 'open');<br> <br></div>to: </div>
<div> </div>
<div>$TicketsObj->LimitCustomField(CUSTOMFIELD => 'OAReqNum', OPERATOR => '=', VALUE => $oa); <br></div>
<div> </div>
<div>but I'm getting error </div>
<div class="im">
<div> </div>
<div>Jun 11 22:13:13 data1 RT: Query error in << ( 'CF.' = 'alert' ) AND ( 'Queue' = 'IT' ) >>: Unknown field: CF. at /opt/rt3/lib/RT/Tickets_Overlay_SQL.pm line 308. Stack: [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:308] [/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:482] [/opt/rt3/lib/RT/Tickets_Overlay.pm:2641] [/opt/rt3/lib/RT/Tickets_Overlay.pm:2314] [(eval 4308):24] [/opt/rt3/lib/RT/ScripAction_Overlay.pm:241] [/opt/rt3/lib/RT/Scrip_Overlay.pm:507] [/opt/rt3/lib/RT/Scrips_Overlay.pm:192] [/opt/rt3/lib/RT/Transaction_Overlay.pm:170] [/opt/rt3/lib/RT/Record.pm:1438] [/opt/rt3/lib/RT/Ticket_Overlay.pm:720] [/opt/rt3/lib/RT/Interface/Email.pm:765] [/opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway:58] (/opt/rt3/lib/RT/Tickets_Overlay_SQL.pm:484)</div>
<div> </div>
<div> </div></div>
<div>'m guessing, this is because I do not a CustomField. I attached our RT interface. Anybody kindly help, identify the problem.</div>
<div> </div></blockquote>
<div> </div>
<div>My RT interface shows some of this information: </div>
<div> </div></div>
<div> </div>
<div> <span class="title">#2345: Re: ** PROBLEM alert - Echo PC02/check_usa is CRITICAL **</span> </div>
<div><span class="titleboxtitle"><b>Ticket metadata</b> </span></div>
<div><span class="titleboxtitle"> The Basics:</span></div>
<div><span class="titleboxtitle"> Id: 2345</span></div>
<div><span class="titleboxtitle"> Status: new </span></div>
<div><span class="titleboxtitle"> Left: 0 min</span></div>
<div><span class="titleboxtitle"> Priority: 60/0</span></div>
<div><span class="titleboxtitle"> Queue: IT </span></div>
<div><span class="titleboxtitle"> Custom Fields: </span></div>
<div><span class="titleboxtitle"> Machine Name: No Value </span></div>
<div><span class="titleboxtitle"> Customer: No Value </span></div>
<div><span class="titleboxtitle"> People: </span></div>
<div><span class="titleboxtitle"> Owner: Nobody </span></div>
<div><span class="titleboxtitle"> Requestors: <a href="mailto:rmp.dmd1229@gmail.com">rmp.dmd1229@gmail.com</a> </span></div>
<div> </div>
<div> </div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><span id=""></span></div>
<div>Thanks!</div>
<div>Roehl</div></blockquote>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><span id=""></span><br></div>
<div>
<div></div>
<div class="h5">
<div class="gmail_quote">On Thu, Jun 11, 2009 at 3:44 PM, rmp dmd <span dir="ltr"><<a href="mailto:rmp.dmd1229@gmail.com" target="_blank">rmp.dmd1229@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Thank you very much Raed. </div>
<div> </div>
<div>This problem explains while I merging the newly created tickets to a ticket with status 'new' on the top of the list. </div>
<div> </div>
<div>I need to merge new ticket to an existing ticket with subject matching ** PROBLEM - any words - CRITICAL ** .</div>
<div> </div>
<div>1st request, this is a match: <span>#2316: </span>** PROBLEM alert - Echo PC02/check_usa is CRITICAL ** </div>
<div>2nd request, this is a match: <span>#2317: </span>** PROBLEM alert - Echo PC02/check_usa is CRITICAL ** </div>
<div><span></span> </div>
<div>The existing ticket has an ID: 2312 with Subject: ** PROBLEM alert - Echo PC02/check_usa is CRITICAL ** </div>
<div> </div>
<div>I will merge ticket 2316 and 2317 with 2312. </div>
<div> </div>
<div>Somehow this merge to a ticket DRP with ID 720. This is ticket is on the top of IT queue list</div>
<div> </div>
<div>223 Centralize Sever login open IT <br>668 test on Saturn open IT <br>720 DRP new IT <br>745 Backup - all corporate open IT <br>873 Image Ken Gen open IT<br>1135 DSS-3 tapes new IT </div>
<div> </div>
<div>Below is the script. I hope somebody can help.</div>
<div> </div>
<div>Thanks!</div>
<div>Roehl</div>
<div> </div>
<div>my $oa = undef; </div>
<div>
<div>my $Transaction = $self->TransactionObj; <br>my $subject = $Transaction->Attachments->First->GetHeader('Subject'); <br></div>if ( $subject =~ /\*\* PROBLEM (\w+) - (.*) (\w+) \*\*/ ) {<br>$oa = $1; <br>
#$RT::Logger->debug("Found oa: $oa"); <br>} <br>else { return 1; } </div>
<div><br>my $TicketsObj = RT::Tickets->new($RT::SystemUser); <br>$TicketsObj->LimitQueue(VALUE => 'IT'); <br>$TicketsObj->LimitStatus(VALUE => 'new');<br>$TicketsObj->LimitStatus(VALUE => 'open');</div>
<div> </div>
<div> </div>
<div>if ($TicketsObj->Count == 0) { return 1; } <br>my $id = undef; <br>while (my $ticket = $TicketsObj->Next) { <br>
<div>next if $self->TicketObj->Id == $ticket->Id; <br></div>$id = $ticket->Id; <br>last; <br>} </div>
<div>$id || return 1; </div>
<div>
<div>$RT::Logger->debug("Merging ticket " . $self->TicketObj->Id . " into $id because of OA number match."); <br>$self->TicketObj->MergeInto($id); <br></div>1; </div></blockquote></div>
<br></div></div></blockquote></div><br>