[rt-users] callback for autoclose in RT4

Kevin Falcone falcone at bestpractical.com
Tue Mar 20 20:32:08 EDT 2012


On Tue, Mar 20, 2012 at 10:34:42AM +0100, inbel1 at telenet.be wrote:
> >    We automatically close our tickets when replying to the requestor.
> > 
> >    In RT3 I changed .../Ticket/Update.html
> > 
> >    from:
> > 
> >    if ($DefaultStatus =~ '~new$') {
> > 
> >             $DefaultStatus = 'open';
> > 
> >    }
> 
> >>We actually removed this code in 4.0, because all the status changes
> >>are controlled by Lifecycles or Scrips
> 
> >    *** If you use a scrip, the ticket will always be closed (it's a post action).
> >    Default behavior should be: close it, but users should be able to override this by selecting
> >    another status from the drop down box.
> 
> >>That's what happens with On Correspond Open Ticket, the default RT
> >>scrip.  If you notice, you can pick Resolve on the list and it'll end
> >>up resolved, even if you correspond.  You can also use Lifecycles to
> >>control some of the tabs that users use to get to the Reply page.
> >>You may need to use a callback to modify the Menu that links Reply.
> 
> Lifecycles can't do the trick for this scenario.
> I'm trying to write a callback that changes the status depending on comment/respond.
> 
> SelectStatus DefaultLabel should become 'resolved' in the update.html screen when you select Correspond.
> SelectStatus DefaultLabel should stay unchanged in the update.html screen when you select Comment.
> 
> But I don't seem t find the correct 'hook' to do this.

You want the Privileged callback in Elements/Tabs so you can change
the arguments passed in the link.  You'll need to poke around in the
data structure you get back from PageMenu using the API in
RT::Interface::Web::Menu.  There's a wiki page about adding menu items
you might find helpful.

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120320/bb6b066b/attachment.sig>


More information about the rt-users mailing list