Ticket next status dependant on reply

Moderator: crythias

Locked
Letter
Znuny newbie
Posts: 13
Joined: 29 May 2013, 10:25
Znuny Version: 3.2.7

Ticket next status dependant on reply

Post by Letter »

Hello,

We used to run OTRS 2.4.X and had modified our AgentTicketCompose.dtl to have the selected next ticket status based on the reply choice in order to save time.
Our goal was to have the ticket next status set to closed successful by default when we chose a "close-EN" or "close-DE" or "clse-FR" with the appropriate message language predefined.

The code was :

Code: Select all

<!-- start - manually insert for default answer -->
<dtl if ($Data{"ResponseID"} eq "3") { $Data{"NextStatesStrg"} = "<select name=StateID> <option value=13>$Text{"closed rejected"}</option> <option value=2 selected=selected>$Text{"closed successful"}</option> <option value=3>$Text{"closed unsuccessful"}</option> <option value=10>$Text{"closed with workaround"}</option> <option value=4>$Text{"open"}</option> <option value=7>$Text{"pending auto close+"}</option> <option value=8>$Text{"pending auto close-"}</option> <option value=12>$Text{"pending customer"}</option> <option value=11>$Text{"pending extern"}</option> <option value=6>$Text{"pending reminder"}</option> </select> <a id=AJAXImageStateID />"; }>
...
...
...
<!-- start - manually insert for default answer -->
<td class="contentkey">$Text{"Next ticket state"}:</td>
<td class="contentvalue">$Data{"NextStatesStrg"}</td>                
We now would like to do the same thing in otrs 3.2 but the syntax is no longer the name and having nobody that really masters pearl, it is not and easy.
Has anyone done this already in 3.2?
Is there a simpler way we don't know of? Using the close function with default body doesn't suit us because of the multiple languages involved.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Ticket next status dependant on reply

Post by crythias »

Kernel/Output/Standard/AgentTicketCompose.dtl:

at the bottom:

Code: Select all

<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    Core.Agent.TicketAction.Init();
if ($Data{"ResponseID"} == 3)  document.getElementById("StateID").value = 13;
    //]]></script>
<!--dtl:js_on_document_complete-->
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Letter
Znuny newbie
Posts: 13
Joined: 29 May 2013, 10:25
Znuny Version: 3.2.7

Re: Ticket next status dependant on reply

Post by Letter »

Works perfectly, thanks a lot!
Great reactivity there :)
Locked