answer templates depending on ticket status

Moderator: crythias

Post Reply
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

answer templates depending on ticket status

Post by Giulio Soleni »

Hi,
I would like to filter the list of available replies (answer templates) on AgentTicketZoom frontend, based on ticket status.
Actually, we know, reply templates may be related only to queues.

Specifically, if the ticket is "new" I would like the reply menu could show only a template related to a possible "first reply", while once the the ticket is open I would like the menu may show only templates related to a possible follow up reply.

Do you think this can be done without development or code customization? ...maybe using ACL or some configuration parameter?
any hint would be really appreciated.

Giulio
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: answer templates depending on ticket status

Post by aph »

I don't think it is possible, at least not with standard tools. With ACL you could filter by state and depending on that disallow an action (AgentTicketCompose or AgentTicketForward), but not individual values for that action.
You could of course manipulate the available values with HTML code (as in case of dynamic fields, there are threads on restricting dynamic field values based on selection around in the forum)

I wouldn't mind being corrected :D
Last edited by aph on 12 Feb 2016, 13:06, edited 1 time in total.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
Charmacas
Znuny advanced
Posts: 103
Joined: 18 Jan 2016, 10:27
Znuny Version: 5.0.26 on Debian 8

Re: answer templates depending on ticket status

Post by Charmacas »

I would also think that you could solve that with ACLs. But I can't help further. Try allowing all replies and disallow the ones you don't want on a certain status. Shouldn't this do the trick?
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: answer templates depending on ticket status

Post by Giulio Soleni »

thank you for your reply,
as aph said I also am not sure ACL can do the trick.
Trying to limit the possible answer-templates for the new tickets, the best I have got is the following:

Code: Select all

Properties
	Frontend
		Action:
			AgentTicketZoom
	State
		TypeID:
			1
			
PossibleNot
	Action
		AgentTicketCompose
But that does not allow any reply if the ticket is in a new state :|

Well... maybe I have to put my hands somewhere on AgentTicketCompose.pm ... not so happy about that :/

thank you
Giulio
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: answer templates depending on ticket status

Post by Giulio Soleni »

Ok, maybe I found a possible solution editing AgentTicketZoom.pm ...
to share my idea...

Providing I have the following two templates
"Lock and First Reply" with ID: 4 which I would like to use only for new tickets
"Next Reply" with ID: 5 which I would like to use for open (or better not new) tickets
I adjusted AgentTicketZoom.pm file in the following way:

Code: Select all

                # get StandardResponsesStrg
                my %StandardResponseHash = %{ $Param{StandardResponses} || {} };
                
# CUSTOM EDIT BEGIN 
if ($Ticket{State} =~ /new/) {
  # delete "Lock and First Reply" template if state is new
  delete $StandardResponseHash{4};
}
else {
  # delete "Next Reply" template if state is NOT new
  delete $StandardResponseHash{5};
}
# CUSTOM EDIT END
That is, right after the %StandardResponseHash has been defined with all the key/value pairs for all the available templates, I delete the entry which I do not want for the specific ticket state.

Still checking ... but I think that this could be a solution.
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
Post Reply