Mailing List Archive

callback for autoclose in RT4
We automatically close our tickets when replying to the requestor.
In RT3 I changed .../Ticket/Update.html
from:
if ($DefaultStatus =~ '~new$') {
         $DefaultStatus = 'open';
}
to:
if (($DefaultStatus =~ '~new$' || $DefaultStatus =~ '~open $') && Action eq 'Respond') {
         $DefaultStatus = 'resolved ';
}

Now we have migrated to 4.0.5, but I can't find the correct callback to do this.

Anyone a clue or hint?
Re: callback for autoclose in RT4 [ In reply to ]
We automatically close our tickets when replying to the requestor.
In RT3 I changed .../Ticket/Update.html
from:
if ($DefaultStatus =~ '~new$') {
         $DefaultStatus = 'open';
}
to:
if (($DefaultStatus =~ '~new$' || $DefaultStatus =~ '~open$') && Action eq 'Respond') {
         $DefaultStatus = 'resolved';
}

Now we have migrated to 4.0.5, but I can't find the correct callback to do this.
 
Anyone a clue or hint?


*** If you use a scrip, the ticket will al ways be closed (it's a post action).
Default behavior should be: close it, but users should be abl e to override this by selecting another status from the drop down box .
Re: callback for autoclose in RT4 [ In reply to ]
On Mon, Mar 19, 2012 at 01:49:52PM +0100, inbel1@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.
Re: callback for autoclose in RT4 [ In reply to ]
> 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.
Re: callback for autoclose in RT4 [ In reply to ]
On Tue, Mar 20, 2012 at 10:34:42AM +0100, inbel1@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