<?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=AutoRedirectToSelfService</id>
	<title>AutoRedirectToSelfService - 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=AutoRedirectToSelfService"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=AutoRedirectToSelfService&amp;action=history"/>
	<updated>2026-08-22T00:02:47Z</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=AutoRedirectToSelfService&amp;diff=255&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=AutoRedirectToSelfService&amp;diff=255&amp;oldid=prev"/>
		<updated>2016-04-06T20:03:17Z</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;I created a custom form for my Help Desk, but I needed a way to redirect users to the form without publishing a new web site for RT. Since most users don&amp;#039;t need to know about all the tickets in the queue, and can&amp;#039;t own tickets, I found a way to redirect them to the Self Service page and added some features to make our lives easier.&lt;br /&gt;
&lt;br /&gt;
In /usr/local/rt3/local/html/index.html add this code to redirect to Self Service if the user can not own a ticket:&lt;br /&gt;
&lt;br /&gt;
 73 %# Redirect to !SelfService if the user can not own tickets&lt;br /&gt;
 74 % my $urefresh = $session{&amp;#039;home_refresh_interval&amp;#039;};&lt;br /&gt;
 75 % if ( ! $session{&amp;#039;CurrentUser&amp;#039;}-&amp;amp;gt;HasRight(Right=&amp;amp;gt;&amp;#039;OwnTicket&amp;#039;, Object=&amp;amp;gt;$RT::System) ) {&lt;br /&gt;
 76 %               $urefresh = &amp;#039;0; URL=&amp;#039; . $RT::WebPath . &amp;#039;/SelfService/index.html&amp;#039;;&lt;br /&gt;
 77 %       }&lt;br /&gt;
 78&lt;br /&gt;
 79 %#&amp;amp;lt;&amp;amp;amp; /Elements/Header, Title=&amp;amp;gt;loc(&amp;quot;RT at a glance&amp;quot;), Refresh =&amp;amp;gt; $session{&amp;#039;home_refresh_interval&amp;#039;} &amp;amp;amp;&amp;amp;gt;&lt;br /&gt;
 80 &amp;amp;lt;&amp;amp;amp; /Elements/Header, Title=&amp;amp;gt;loc(&amp;quot;RT at a glance&amp;quot;), Refresh =&amp;amp;gt; $urefresh &amp;amp;amp;&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In /usr/local/rt3/local/html/SelfService/index.html add this code to list the queues and number of tickets in each queue:&lt;br /&gt;
&lt;br /&gt;
 48 &amp;amp;lt;TABLE BORDER=0 WIDTH=100%&amp;amp;gt;&lt;br /&gt;
 49 &amp;amp;lt;TR VALIGN=TOP&amp;amp;gt;&lt;br /&gt;
 50 &amp;amp;lt;TD WIDTH=70% class=&amp;quot;boxcontainer&amp;quot;&amp;amp;gt;&lt;br /&gt;
 51 &amp;amp;lt;&amp;amp;amp; /SelfService/Elements/MyRequests &amp;amp;amp;&amp;amp;gt;&lt;br /&gt;
 52 &amp;amp;lt;BR&amp;amp;gt;&lt;br /&gt;
 53 &amp;amp;lt;TD class=&amp;quot;boxcontainer&amp;quot;&amp;amp;gt;&lt;br /&gt;
 54 &amp;amp;lt;&amp;amp;amp; /Elements/Quicksearch &amp;amp;amp;&amp;amp;gt;&lt;br /&gt;
 55 &amp;amp;lt;BR&amp;amp;gt;&lt;br /&gt;
 56 &amp;amp;lt;/TABLE&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
My custom Help Desk form is /usr/local/rt3/local/html/SelfService/Create.html and I have this code in there to set the priority of the ticket based on a Drop-Down:&lt;br /&gt;
&lt;br /&gt;
 65 &amp;amp;lt;TR&amp;amp;gt;&lt;br /&gt;
 66 &amp;amp;lt;TD CLASS=label&amp;amp;gt;Priority:&amp;amp;lt;/TD&amp;amp;gt;&lt;br /&gt;
 67 &amp;amp;lt;TD&amp;amp;gt;&amp;amp;lt;SELECT NAME=&amp;quot;InitialPriority&amp;quot;&amp;amp;gt;&lt;br /&gt;
 68         &amp;amp;lt;OPTION VALUE=&amp;quot;10&amp;quot;&amp;amp;gt;Low - Minor Annoyance&lt;br /&gt;
 69         &amp;amp;lt;OPTION VALUE=&amp;quot;30&amp;quot;&amp;amp;gt;Medium - Affects Daily Work&lt;br /&gt;
 70         &amp;amp;lt;OPTION VALUE=&amp;quot;70&amp;quot;&amp;amp;gt;High - Major Disruption&lt;br /&gt;
 71         &amp;amp;lt;OPTION VALUE=&amp;quot;90&amp;quot;&amp;amp;gt;Critical - Class Is Halted&lt;br /&gt;
 72         &amp;amp;lt;/SELECT&amp;amp;gt;&lt;br /&gt;
 73 &amp;amp;lt;/TR&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In /usr/local/rt3/local/html/SelfService/Display.html I have this code to set the due date of a ticket based on the priority:&lt;br /&gt;
&lt;br /&gt;
 109 # Set the due date for helpdesk que based on initial priority&lt;br /&gt;
 110 if ($ARGS{&amp;#039;InitialPriority&amp;#039;} and !$ARGS{&amp;#039;Due&amp;#039;}) {&lt;br /&gt;
 111   my $priority_due = RT::Date-&amp;amp;gt;new($session{&amp;#039;CurrentUser&amp;#039;});&lt;br /&gt;
 112   $priority_due-&amp;amp;gt;SetToNow();&lt;br /&gt;
 113   $priority_due-&amp;amp;gt;AddDays( 10 - ( $ARGS{&amp;#039;InitialPriority&amp;#039;} ) / 10 );&lt;br /&gt;
 114   $ARGS{&amp;#039;Due&amp;#039;} = $priority_due-&amp;amp;gt;ISO();&lt;br /&gt;
 115 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Comment by [[RichardF]], 23 Aug 07:&lt;br /&gt;
&lt;br /&gt;
In RT v3.6.4, I found that passing anything other than an integer as the Refresh parameter to the Header element didn&amp;#039;t result in a redirect being created. Also, to ensure that &amp;quot;semi-privileged&amp;quot; users could not directly access other privileged URLS (eg /User/Prefs.html), I found it easier to simply modify the main autohandler to redirect users who don&amp;#039;t have the [[OwnTicket]] privilege to the [[SelfService]] interface (in the same way that unprivileged users are redirected).&lt;br /&gt;
&lt;br /&gt;
To achieve this, I copied /html/autohandler to /local/html/autohandler, and made the following change to the local copy:&lt;br /&gt;
&lt;br /&gt;
   273 if ( (not $session{&amp;#039;CurrentUser&amp;#039;}-&amp;amp;gt;Privileged) ||&lt;br /&gt;
 -&amp;amp;gt;274      (!$session{&amp;#039;CurrentUser&amp;#039;}-&amp;amp;gt;HasRight(Right=&amp;amp;gt;&amp;#039;OwnTicket&amp;#039;, Object=&amp;amp;gt;$RT::System))&lt;br /&gt;
   275    ){&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>