<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=CloseAll</id>
	<title>CloseAll - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=CloseAll"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=CloseAll&amp;action=history"/>
	<updated>2026-08-23T00:53:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=CloseAll&amp;diff=529&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=CloseAll&amp;diff=529&amp;oldid=prev"/>
		<updated>2016-04-06T20:03:25Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= CloseAll =&lt;br /&gt;
&lt;br /&gt;
Simple perl script to change all TT, but the one in state deleted, in a queue to Resolved&lt;br /&gt;
&lt;br /&gt;
Take one argument &amp;quot;queue name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#!/usr/bin/perl -w&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 use Carp;&lt;br /&gt;
 use Getopt::Long;&lt;br /&gt;
 &lt;br /&gt;
 use lib &amp;#039;/http/www/rt-3.4.5/lib&amp;#039;;&lt;br /&gt;
 use lib &amp;#039;/http/www/rt-3.4.5/etc&amp;#039;;&lt;br /&gt;
 &lt;br /&gt;
 use RT::Interface::CLI qw(CleanEnv GetCurrentUser GetMessageContent loc);&lt;br /&gt;
 CleanEnv();&lt;br /&gt;
 &lt;br /&gt;
 use RT;&lt;br /&gt;
 use RT::Ticket;&lt;br /&gt;
 use RT::Tickets;&lt;br /&gt;
 &lt;br /&gt;
 #Load RT&amp;#039;s config file&lt;br /&gt;
 RT::LoadConfig();&lt;br /&gt;
 &lt;br /&gt;
 # Connect to the database. set up loggign&lt;br /&gt;
 RT::Init();&lt;br /&gt;
 &lt;br /&gt;
 #Get the current queue all loaded&lt;br /&gt;
 my $queue = shift || &amp;#039;--help&amp;#039;;&lt;br /&gt;
 &lt;br /&gt;
 if ($queue eq &amp;#039;--help&amp;#039;) {&lt;br /&gt;
 print &amp;amp;lt;&amp;amp;lt;END;&lt;br /&gt;
 closeall &amp;amp;lt;queue&amp;amp;gt;&lt;br /&gt;
 END&lt;br /&gt;
 exit(0);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 my $Tickets = new RT::Tickets($RT::SystemUser);&lt;br /&gt;
 $Tickets-&amp;amp;gt;LimitWatcher(TYPE =&amp;amp;gt; &amp;#039;Queue&amp;#039;, VALUE =&amp;amp;gt; $queue);&lt;br /&gt;
 $Tickets-&amp;amp;gt;LimitStatus(VALUE =&amp;amp;gt; &amp;#039;Deleted&amp;#039;, OPERATOR =&amp;amp;gt; &amp;#039;!=&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 unless ($Tickets-&amp;amp;gt;Count) {&lt;br /&gt;
 print &amp;quot;tickets not found with queue $queue\n&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 print &amp;quot;Amount of tickets in $queue is &amp;quot;.$Tickets-&amp;amp;gt;Count.&amp;quot;\n&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 while (my $t=$Tickets-&amp;amp;gt;Next) {&lt;br /&gt;
 my ($val,$msg) = $t-&amp;amp;gt;Resolve();&lt;br /&gt;
 if ($val) {&lt;br /&gt;
 print &amp;quot;OK: $msg\n&amp;quot;;&lt;br /&gt;
 } else {&lt;br /&gt;
 print &amp;quot;Not Ok: $msg\n&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 $RT::Handle-&amp;amp;gt;Disconnect();&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>