"New Ticket" Template With Pre-Set Owner & Customer

Moderator: crythias

Locked
mrhaag
Znuny newbie
Posts: 18
Joined: 17 Jun 2011, 14:27
Znuny Version: 4.0.12
Real Name: Michael R. Haag
Company: Madison County, NY
Location: Madison County, NY

"New Ticket" Template With Pre-Set Owner & Customer

Post by mrhaag »

I would like to create a set of ticket templates for my Agents so they can quickly create a new ticket on which they are both Owner and Customer. I have been unable to find advice for creating such a template in the manual ( https://otrs.github.io/doc/manual/admin ... 2.6.5.11.1 mentions adding subject, text, and type to a ticket, but it does not address assignment of Customer and Owner via Template).

I believe the following old OTRS3 post gives clues on how I might accomplish my goal via menu links with actions in the URL string:

https://blog.otrs.org/2010/11/02/otrs-3 ... templates/

But I have found no way to pre-fill Owner and Customer on any ticket template.

How can I make a "New Ticket" template (either phone or email) in which the Owner and Customer are set to currently logged-in Agent?
OTRS 5.0.14 on CentOS release 6.7 (Final) with mysql Ver 15.1 Distrib 5.5.47-MariaDB database connected to an Active Directory for Agents and Customers.
root
Administrator
Posts: 4253
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: "New Ticket" Template With Pre-Set Owner & Customer

Post by root »

Owner depends on the queue - due to permissions. Take a look into the source to understand how it works: https://github.com/OTRS/otrs/blob/rel-5 ... one.pm#L60
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
mrhaag
Znuny newbie
Posts: 18
Joined: 17 Jun 2011, 14:27
Znuny Version: 4.0.12
Real Name: Michael R. Haag
Company: Madison County, NY
Location: Madison County, NY

Re: "New Ticket" Template With Pre-Set Owner & Customer

Post by mrhaag »

I am closer to what I want than I realized: If an Agent selects no Owner on ticket creation, the Owner is set to that Agent. Now I only need to find a way to define Customer as the same Agent who is creating the ticket. Since "Customer User" accounts are completely separate from Agent accounts, finding an Agent's "Customer User" account might be a bit tricky. We have our "Agent" username strings set to match the exact format of the "Customer User" username strings, so each Agent has a corresponding "Customer User" account.

How can I pre-populate the "Customer User" field with the Agent's "Customer User" account?

Is it possible to do so via the URL?

Is it possible to do so via a ticket template?
OTRS 5.0.14 on CentOS release 6.7 (Final) with mysql Ver 15.1 Distrib 5.5.47-MariaDB database connected to an Active Directory for Agents and Customers.
mrhaag
Znuny newbie
Posts: 18
Joined: 17 Jun 2011, 14:27
Znuny Version: 4.0.12
Real Name: Michael R. Haag
Company: Madison County, NY
Location: Madison County, NY

Re: "New Ticket" Template With Pre-Set Owner & Customer

Post by mrhaag »

I have successfully accomplished pre-set Customer (and other fields) using URL.

Example:

https://www.example.com/otrs/index.pl?A ... ;TypeID=3;

The following <div> on the source HTML generated by index.pl on the AgentTicketPhone action gave clues on which form field IDs to enter into URL string:

Code: Select all

        <div class="ContentColumn">
            <form action="/otrs/index.pl" method="post" enctype="multipart/form-data" name="compose" id="NewPhoneTicket" class="Validate PreventMultipleSubmits"><input type="hidden" name="ChallengeToken" value="RT9MOvOZOOBelDP8RHrXEncQe0oRhqbO"/>
                <input type="hidden" name="Action" value="AgentTicketPhone"/>
                <input type="hidden" name="Subaction" value="StoreNew"/>
                <input type="hidden" name="FormID" value="1479411303.11378328.6074565"/>
                <input type="hidden" name="ExpandCustomerName" id="ExpandCustomerName" value="0"/>
                <input type="hidden" name="OwnerAll" id="OwnerAll" value=""/>
                <input type="hidden" name="ResponsibleAll" id="ResponsibleAll" value=""/>
                <input type="hidden" name="PreSelectedCustomerUser" id="PreSelectedCustomerUser" value=""/>
                <input type="hidden" name="SelectedCustomerUser" id="SelectedCustomerUser" value="user.name"/>
                <input type="hidden" name="TicketID" value=""/>
                <input type="hidden" name="LinkTicketID" value=""/>
                <input type="hidden" name="FromChatID" value=""/>

                <fieldset class="TableLike">

                    <label class="Mandatory" for="TypeID"><span class="Marker">*</span> Type:</label>
                    <div class="Field">
                        <select class="Modernize Validate_Required " id="TypeID" name="TypeID">
  <option value="">-</option>
  <option value="4">Technology Purchase</option>
  <option value="2">Trouble Ticket</option>
  <option value="3">Work Request</option>
</select>
                        <div id="TypeIDError" class="TooltipErrorMessage"><p>This field is required.</p></div>
                        <div id="TypeIDServerError" class="TooltipErrorMessage"><p>This field is required.</p></div>

                    </div>
                    
Next I will need to add custom menu items to each agent using their names as the "SelectedCustomerUser" and "PreSelectedCustomerUser".
OTRS 5.0.14 on CentOS release 6.7 (Final) with mysql Ver 15.1 Distrib 5.5.47-MariaDB database connected to an Active Directory for Agents and Customers.
Locked